Clean up handling of NPE when sending a message

b/13037992
We don't want to abort the entire sync if writing the
temporary file fails.

Change-Id: Idc90ad64d961b24d46975b89ad65b2456cd19413
(cherry picked from commit f6158587a963720526d72ba118ad710e21d1c5d2)
3 files changed