perfetto: ensure that we don't finalize message when message is shared

When a message is shared across handles and we perform a move into a
reference from a temporary handle, we finalize the message even
though we then make the reference handle point to this message and
expect it to be unfinalized.

Fix this subtle bug by ensuring that if we are sharing messages across
handles that we don't finalize and add a check to make sure that the
moved in handle is also not finalized.

Test: ProtoZeroMessageHandleTest
Change-Id: I57cd9439da8ba049a7f0967e99fea261495daf64
diff --git a/Android.bp b/Android.bp
index 84afdc6..d29c54c 100644
--- a/Android.bp
+++ b/Android.bp
@@ -769,6 +769,7 @@
     "src/protozero/proto_utils_unittest.cc",
     "src/protozero/protozero_message.cc",
     "src/protozero/protozero_message_handle.cc",
+    "src/protozero/protozero_message_handle_unittest.cc",
     "src/protozero/protozero_message_unittest.cc",
     "src/protozero/scattered_stream_writer.cc",
     "src/protozero/scattered_stream_writer_unittest.cc",