Enhance ScopedUtfChars to include the null check most callers were missing.

Also switch most non-users over to ScopedUtfChars.

Also ensure all users check that ScopedUtfChars was successful in getting the
chars.

Also rewrite ObjectInputStream and ObjectOutputStream without duplication.

Change-Id: I929d00fe3ff50b303cba4a2cf2269355e9fef5f9
14 files changed