Substitute George Earthy netted a 10-minute second-half double as Bristol City came from behind to leap into the Championship play-off spots with a thrilling 2-1 victory over Middlesbrough at Ashton Gate.