logcat: add hidden --debug flag and cleanup

Allow us to debug corrupted log messages. Fix liblog to propagate
errors correctly and repair a gtest that failed.

Test: liblog-unit-tests --gtest_filter=liblog.__android_log_bswrite_and_print___max
      logcat -b events --debug -t 50
Bug: 32903864
Change-Id: Ib4eb9f466777cd23b8b54728d36354590d07869a
3 files changed
tree: 7b506873f1b84a010911af9ec341ff4b03fb4069
  1. liblog/
  2. logcat/
  3. logd/
  4. logwrapper/