Add write() impl to SyncSocket for NaCl.  Fix shutdown leaks.

Necessary for https://codereview.chromium.org/22886005/

Also fixes return codes from size_t methods to avoid signed
values from being returned.

BUG=289124
TEST=build nacl, audio still works.

Review URL: https://codereview.chromium.org/27029009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229895 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 229895
Cache force-installed apps/extensions in device-local accounts

This CL adds the DeviceLocalAccountExternalPolicyLoader, a replacement for
the ExternalPolicyLoader that caches force-installed apps/extensions,
allowing them to be installed offline. The caches for individual accounts
are managed by the DeviceLocalAccountPolicyService which makes sure to
remove obsolete cache directories.

BUG=287802
TEST=Full coverage with new browser and unit tests

Review URL: https://codereview.chromium.org/27548004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229896 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 229896