Fix bug in header protocol for thrift in D when nothing is in the buffer but transport.peek is true.
Fix bug in header protocol for thrift in D when nothing is in the buffer but transport.peek is true.

Summary: It ends up calling super.read, which in return call readFrame, which is incorrect. Checking the state of the buffer instead of relying on peek.

Test Plan: D1691823

Reviewed By: markisaa@fb.com

Subscribers: alandau, bmatheny, mshneer, tranta, yfeldblum

FB internal diff: D1814728

Signature: t1:1814728:1422594530:479ab67586b076ef4a8552cc7b2163f9762791a9

sinjar666/fbthrift,kangkot/fbthrift,uber/fbthrift,getyourguide/fbthrift,raphaelamorim/fbthrift,facebook/fbthrift,getyourguide/fbthrift,HankFaan/fbthrift,facebook/fbthrift,fengshao0907/fbthrift,soumith/fbthrift,HankFaan/fbthrift,SergeyMakarenko/fbthrift,guker/fbthrift,chjp2046/fbthrift,SergeyMakarenko/fbthrift,maxwell-demon/fbthrift,sinjar666/fbthrift,soumith/fbthrift,getyourguide/fbthrift,uber/fbthrift,uber/fbthrift,uber/fbthrift,facebook/fbthrift,LinusU/fbthrift,LinusU/fbthrift,Orvid/fbthrift,LinusU/fbthrift,sinjar666/fbthrift,raphaelamorim/fbthrift,maxwell-demon/fbthrift,getyourguide/fbthrift,getyourguide/fbthrift,chjp2046/fbthrift,chjp2046/fbthrift,fengshao0907/fbthrift,SergeyMakarenko/fbthrift,Orvid/fbthrift,SergeyMakarenko/fbthrift,SergeyMakarenko/fbthrift,HankFaan/fbthrift,guker/fbthrift,HankFaan/fbthrift,soumith/fbthrift,kangkot/fbthrift,facebook/fbthrift,getyourguide/fbthrift,LinusU/fbthrift,uber/fbthrift,Orvid/fbthrift,soumith/fbthrift,LinusU/fbthrift,HankFaan/fbthrift,project-zerus/fbthrift,kangkot/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,guker/fbthrift,project-zerus/fbthrift,chjp2046/fbthrift,sinjar666/fbthrift,fengshao0907/fbthrift,project-zerus/fbthrift,guker/fbthrift,SergeyMakarenko/fbthrift,LinusU/fbthrift,chjp2046/fbthrift,raphaelamorim/fbthrift,chjp2046/fbthrift,guker/fbthrift,fengshao0907/fbthrift,sinjar666/fbthrift,guker/fbthrift,raphaelamorim/fbthrift,raphaelamorim/fbthrift,getyourguide/fbthrift,project-zerus/fbthrift,raphaelamorim/fbthrift,kangkot/fbthrift,soumith/fbthrift,sinjar666/fbthrift,guker/fbthrift,Orvid/fbthrift,facebook/fbthrift,Orvid/fbthrift,guker/fbthrift,kangkot/fbthrift,project-zerus/fbthrift,fengshao0907/fbthrift,kangkot/fbthrift,project-zerus/fbthrift,maxwell-demon/fbthrift,guker/fbthrift,Orvid/fbthrift,fengshao0907/fbthrift,Orvid/fbthrift,fengshao0907/fbthrift,fengshao0907/fbthrift,HankFaan/fbthrift,raphaelamorim/fbthrift,sinjar666/fbthrift,uber/fbthrift,chjp2046/fbthrift,HankFaan/fbthrift,chjp2046/fbthrift,maxwell-demon/fbthrift,uber/fbthrift,uber/fbthrift,maxwell-demon/fbthrift,soumith/fbthrift,chjp2046/fbthrift,guker/fbthrift,chjp2046/fbthrift,sinjar666/fbthrift,Orvid/fbthrift,uber/fbthrift,facebook/fbthrift,raphaelamorim/fbthrift,soumith/fbthrift,facebook/fbthrift,Orvid/fbthrift,HankFaan/fbthrift,raphaelamorim/fbthrift,LinusU/fbthrift,uber/fbthrift,fengshao0907/fbthrift,raphaelamorim/fbthrift,getyourguide/fbthrift,HankFaan/fbthrift,fengshao0907/fbthrift,SergeyMakarenko/fbthrift,chjp2046/fbthrift,Orvid/fbthrift,kangkot/fbthrift,project-zerus/fbthrift,uber/fbthrift,SergeyMakarenko/fbthrift,kangkot/fbthrift,LinusU/fbthrift,project-zerus/fbthrift,guker/fbthrift,fengshao0907/fbthrift,facebook/fbthrift,raphaelamorim/fbthrift,LinusU/fbthrift,project-zerus/fbthrift,SergeyMakarenko/fbthrift,sinjar666/fbthrift,uber/fbthrift,chjp2046/fbthrift,soumith/fbthrift,kangkot/fbthrift,facebook/fbthrift,getyourguide/fbthrift,getyourguide/fbthrift,getyourguide/fbthrift,LinusU/fbthrift,maxwell-demon/fbthrift,SergeyMakarenko/fbthrift,project-zerus/fbthrift,kangkot/fbthrift,maxwell-demon/fbthrift,kangkot/fbthrift,soumith/fbthrift,soumith/fbthrift,sinjar666/fbthrift,SergeyMakarenko/fbthrift,LinusU/fbthrift,project-zerus/fbthrift,maxwell-demon/fbthrift,HankFaan/fbthrift,maxwell-demon/fbthrift,maxwell-demon/fbthrift,maxwell-demon/fbthrift,project-zerus/fbthrift,Orvid/fbthrift,sinjar666/fbthrift,soumith/fbthrift,HankFaan/fbthrift