shared_memory: improve error messages on failure.
shared_memory: improve error messages on failure.

Be careful to leave errno untouched if the file open fails, so that
the latter logging statements that print errno will print the right
message.  Also format the logging text such that the perror-like
output (appending text like ": Permission denied") makes more sense.

Previously we'd end up printing text like
   Try [...] to fix.: Permission denied

BUG=57305
TEST=shared_memory_unittest should still pass

Review URL: http://codereview.chromium.org/3517003

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

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