Fix AudioPipeReader to handle EOF properly.
Fix AudioPipeReader to handle EOF properly.

PulseAudio is started on demand. When PulseAudio is not started read() alaways
returns 0 (i.e. EOF). Normally pulseaudio is started on demand by libpulse so that
it can be restarted after it's stoped or crashed. Previously AudioPipeReader::DoCapture()
didn't handle properly the case when read() returns 0, which would cause it to get into 
indefinite loop when pulseaudio is not started.

BUG=167801

Review URL: https://chromiumcodereview.appspot.com/11744009

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@174913 0039d316-1c4b-4281-b951-d872f2087c98

jaruba/chromium.src,hujiajie/pa-chromium,Chilledheart/chromium,jaruba/chromium.src,anirudhSK/chromium,Just-D/chromium-1,ltilve/chromium,markYoungH/chromium.src,anirudhSK/chromium,littlstar/chromium.src,bright-sparks/chromium-spacewalk,Jonekee/chromium.src,bright-sparks/chromium-spacewalk,krieger-od/nwjs_chromium.src,ltilve/chromium,M4sse/chromium.src,littlstar/chromium.src,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,M4sse/chromium.src,ltilve/chromium,dednal/chromium.src,zcbenz/cefode-chromium,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,Chilledheart/chromium,Just-D/chromium-1,axinging/chromium-crosswalk,Jonekee/chromium.src,markYoungH/chromium.src,Chilledheart/chromium,littlstar/chromium.src,dednal/chromium.src,markYoungH/chromium.src,dednal/chromium.src,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,patrickm/chromium.src,Chilledheart/chromium,timopulkkinen/BubbleFish,bright-sparks/chromium-spacewalk,bright-sparks/chromium-spacewalk,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,fujunwei/chromium-crosswalk,ondra-novak/chromium.src,Jonekee/chromium.src,axinging/chromium-crosswalk,axinging/chromium-crosswalk,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,ondra-novak/chromium.src,bright-sparks/chromium-spacewalk,Fireblend/chromium-crosswalk,Pluto-tv/chromium-crosswalk,mogoweb/chromium-crosswalk,markYoungH/chromium.src,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,fujunwei/chromium-crosswalk,nacl-webkit/chrome_deps,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,chuan9/chromium-crosswalk,ltilve/chromium,zcbenz/cefode-chromium,nacl-webkit/chrome_deps,M4sse/chromium.src,mogoweb/chromium-crosswalk,axinging/chromium-crosswalk,ltilve/chromium,ondra-novak/chromium.src,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,crosswalk-project/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,timopulkkinen/BubbleFish,nacl-webkit/chrome_deps,timopulkkinen/BubbleFish,anirudhSK/chromium,mogoweb/chromium-crosswalk,Jonekee/chromium.src,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,mogoweb/chromium-crosswalk,pozdnyakov/chromium-crosswalk,M4sse/chromium.src,timopulkkinen/BubbleFish,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk,mogoweb/chromium-crosswalk,patrickm/chromium.src,Pluto-tv/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,jaruba/chromium.src,axinging/chromium-crosswalk,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,ondra-novak/chromium.src,chuan9/chromium-crosswalk,littlstar/chromium.src,hgl888/chromium-crosswalk-efl,jaruba/chromium.src,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,zcbenz/cefode-chromium,ChromiumWebApps/chromium,patrickm/chromium.src,dednal/chromium.src,chuan9/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,dednal/chromium.src,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,patrickm/chromium.src,zcbenz/cefode-chromium,zcbenz/cefode-chromium,ChromiumWebApps/chromium,krieger-od/nwjs_chromium.src,Just-D/chromium-1,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,anirudhSK/chromium,hujiajie/pa-chromium,ondra-novak/chromium.src,patrickm/chromium.src,jaruba/chromium.src,axinging/chromium-crosswalk,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,nacl-webkit/chrome_deps,hujiajie/pa-chromium,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,Jonekee/chromium.src,littlstar/chromium.src,hgl888/chromium-crosswalk,bright-sparks/chromium-spacewalk,ltilve/chromium,Just-D/chromium-1,anirudhSK/chromium,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk,timopulkkinen/BubbleFish,nacl-webkit/chrome_deps,PeterWangIntel/chromium-crosswalk,patrickm/chromium.src,nacl-webkit/chrome_deps,PeterWangIntel/chromium-crosswalk,anirudhSK/chromium,krieger-od/nwjs_chromium.src,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,bright-sparks/chromium-spacewalk,patrickm/chromium.src,Jonekee/chromium.src,dushu1203/chromium.src,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,hujiajie/pa-chromium,axinging/chromium-crosswalk,littlstar/chromium.src,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,dushu1203/chromium.src,ondra-novak/chromium.src,M4sse/chromium.src,mogoweb/chromium-crosswalk,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,ondra-novak/chromium.src,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,zcbenz/cefode-chromium,ltilve/chromium,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,ltilve/chromium,Chilledheart/chromium,patrickm/chromium.src,hujiajie/pa-chromium,nacl-webkit/chrome_deps,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,dednal/chromium.src,Chilledheart/chromium,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,jaruba/chromium.src,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,markYoungH/chromium.src,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,nacl-webkit/chrome_deps,dushu1203/chromium.src,markYoungH/chromium.src,anirudhSK/chromium,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,ltilve/chromium,M4sse/chromium.src,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,chuan9/chromium-crosswalk,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,ondra-novak/chromium.src,ondra-novak/chromium.src,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,anirudhSK/chromium,Just-D/chromium-1,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,mogoweb/chromium-crosswalk,anirudhSK/chromium,anirudhSK/chromium,pozdnyakov/chromium-crosswalk,chuan9/chromium-crosswalk,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk-efl,hujiajie/pa-chromium,hgl888/chromium-crosswalk,dednal/chromium.src,ChromiumWebApps/chromium,markYoungH/chromium.src,nacl-webkit/chrome_deps,TheTypoMaster/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,hujiajie/pa-chromium,Just-D/chromium-1,markYoungH/chromium.src,mogoweb/chromium-crosswalk,zcbenz/cefode-chromium,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,axinging/chromium-crosswalk,markYoungH/chromium.src,zcbenz/cefode-chromium,littlstar/chromium.src,hujiajie/pa-chromium,hgl888/chromium-crosswalk,dushu1203/chromium.src,zcbenz/cefode-chromium,littlstar/chromium.src,dushu1203/chromium.src,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,chuan9/chromium-crosswalk,mogoweb/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,dednal/chromium.src,hujiajie/pa-chromium,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,Jonekee/chromium.src,Jonekee/chromium.src,zcbenz/cefode-chromium,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,jaruba/chromium.src,Jonekee/chromium.src,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,anirudhSK/chromium,dednal/chromium.src,M4sse/chromium.src,anirudhSK/chromium,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,patrickm/chromium.src,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk