Fix to enable streaming container logs reliably
Fix to enable streaming container logs reliably

Started a ubuntu container that just runs "ping 8.8.8.8" and tried
the sample code in https://gist.github.com/dims/c3327f633c526847c8e5
to recreate the problem mentioned in:
https://github.com/docker/docker-py/issues/300

To debug the problem i printed the byte array read in recvall
when reading STREAM_HEADER_SIZE_BYTES and realized that the data
being read was far ahead of the actual start of the header documented
in the vnd.docker.raw-stream of the docker remote api. This is
possibly because the requests/urllib3 is reading ahead a bit more
and we shouldn't be trying to hack the internals of those projects.
So just using the documented file-like response.raw is good enough
for us to get the functionality we need which is being able to
read for exactly where the stream header starts. With this change
i can reliably stream the logs just like "docker logs --follow".

Note that we still need to access the underlying socket to set
the timeout to prevent read time outs. The original fix was for
client.logs() only but on further review it made sense to replace
all occurances of _multiplexed_socket_stream_helper with the
new method.

olsaki/docker-py,kpavel/docker-py,terminalmage/docker-py,aiden0z/docker-py,ticosax/docker-py,shishir-a412ed/docker-py,mrfuxi/docker-py,v-boyko/docker-py,wallrj/docker-py,rancher/docker-py,ClusterHQ/docker-py,hibooboo2/docker-py,stevenewey/docker-py,dimaspivak/docker-py,bfirsh/docker-py,MohamedAshiqrh/docker-py,mark-adams/docker-py,kaiyou/docker-py,ColinHuang/docker-py,erikced/docker-py,uggla/docker-py,dnephin/docker-py,runcom/docker-py,jhowardmsft/docker-py,rschmidtz/docker-py,auready/docker-py,mnowster/docker-py,PierreF/docker-py,bboreham/docker-py,youhong316/docker-py,funkyfuture/docker-py,tbeadle/docker-py,ssanderson/docker-py,Ye-Yong-Chi/docker-py,rastaman/docker-py,auready/docker-py,gamechanger/docker-py,sourcelair/docker-py,mangalaman93/docker-py,docker/docker-py,ColinHuang/docker-py,jamesmarva/docker-py,jpopelka/docker-py,Faylixe/docker-py,zwqzhangweiqiang/docker-py,dimaspivak/docker-py,leolujuyi/docker-py,vdemeester/docker-py,bfirsh/docker-py,minzhang28/docker-py,kaiyou/docker-py,tangkun75/docker-py,aiden0z/docker-py,TomasTomecek/docker-py,mohitsoni/docker-py,rhatdan/docker-py,vdemeester/docker-py,tristan0x/docker-py,dlorenc/docker-py,vitalyisaev2/docker-py,paulbellamy/docker-py,Faylixe/docker-py,schu/docker-py,docker/docker-py,tshauck/docker-py,clarete/docker-py,vpetersson/docker-py,wehkamp/docker-py,Melraidin/docker-py,mikedougherty/docker-py,youhong316/docker-py,delfick/docker-py,vpetersson/docker-py,minzhang28/docker-py,wlan0/docker-py,funkyfuture/docker-py