Middlesbrough secured a top-half finish in the Sky Bet Championship with an emphatic 4-1 win over relegated Yeovil at Huish Park.