Check and log some errors.

Log the streamError whenever we fail to write during compression,
and log any failures when removing the original file or cleaning up
the temporary file after compression failed.

This cset is picking up the rebased 5f5c3e522e.
Fix a rare crash caused by an unchecked return value.

Fix a rare crash in CompressingLogFileManager caused by an
unchecked result from read.  If the read fails, it returns -1.
This was then added to inputDataSize, which in turn is added to
inputRemaining further down the function, and used as an input
to memmove (and is unsigned to boot, so it'll be very large rather than
negative).  This means that the memmove stomps all over memory,
and we crash not long afterwards (often when an autorelease pool is
freed).

This crash is rare because it depends on the read call failing.

Fix this by checking the return value from NSStream.read, and leaving
the loop immediately if there's an error.
Set NSFileProtectionKey on the temporary file created during compression.

This uses the same protection for the temporary file as is used on
the log file itself.  This means that it has the same security
characteristics.  Also, if the app can run in the background, this
means that it gets NSFileProtectionCompleteUntilFirstUserAuthentication
so that we can do this compression even with the device locked.

This means that in effect we pick up the same decision as used in
DDFileLogger around doesAppRunInBackground.
Undef NSLog* macros before defining them locally.

This means that these definitions don't clash with any that might be
picked up from a .pch.