CommandProcessor: start dump implementation

Update CommandProcessor, to support dumping existing
logs. In order to keep the CL size reasonable, this
CL only implements dumping of the timestamps of each
message. Dumping the payload will be added in a follow-on
CL.

Note that the new unit tests use ::testing::Invoke(),
in a way that mixes the mocking and faking test
strategies in a single object. The GMock documentation
discourages this kind of mixing, in favor of splitting
a class into one piece that is to be mocked, and another
that is to be faked [1].

The reason we mix the strategies, despite the recommendation
to the contrary, is that we don't always want to fake
Os::Write(). Some times, we just want to mock that method.

Along the way:
- add a ScopedRewinder to MessageBuffer
- add the kDumpBuffers command to protocol::Opcode.
  This command is numbered 0x20, to leave room for
  addition kWrite<MessageType> commands.

[1]
https://github.com/google/googletest/blob/master/googlemock/docs/v1_6/CookBook.md
Specifically, "Having to mix a mock and a fake..."

Bug: 32098312
Test: ./runtests.sh
Change-Id: If221b47ae5615bbc114db5755ce9eb46b9934b6e
diff --git a/message_buffer.h b/message_buffer.h
index 15e394e..e56aa95 100644
--- a/message_buffer.h
+++ b/message_buffer.h
@@ -32,6 +32,18 @@
 // a sequence of messages.
 class MessageBuffer {
  public:
+  // A wrapper which guarantees that a MessageBuffer will be rewound,
+  // when the program exits the wrapper's scope. The user must ensure that
+  // |buffer| does not expire before the ScopedRewinder.
+  class ScopedRewinder {
+   public:
+    explicit ScopedRewinder(NONNULL MessageBuffer* buffer) : buffer_(buffer) {}
+    ~ScopedRewinder() { buffer_->Rewind(); }
+
+   private:
+    MessageBuffer* const buffer_;
+  };
+
   // Constructs the buffer. |size| must be greater than GetHeaderSize().
   explicit MessageBuffer(size_t size);