lshal: flush at the end of Lshal::main().

The _exit() call in main() terminates the whole
process early without debug information properly
flushed. That is, the PipeRelay thread might have
finished but the written data is not flushed. Hence
properly flush at the end of Lshal::main
to ensure the debug data is properly written to
the output stream.

Test: manually with
  adb shell lshal debug android.hardware.media.c2@1.2::IComponentStore/software
Test: manually with
  adb bugreport
  then check lshal-debug/android.hardware.media.c2@1.2__IComponentStore_software.txt
Bug: 323268003
Bug: 311143089
Change-Id: I792d778eaad0fcd58be12e57c864a1d4c79de2d6
diff --git a/cmds/lshal/NullableOStream.h b/cmds/lshal/NullableOStream.h
index 7cffcf8..1576486 100644
--- a/cmds/lshal/NullableOStream.h
+++ b/cmds/lshal/NullableOStream.h
@@ -59,6 +59,11 @@
     operator bool() const { // NOLINT(google-explicit-constructor)
         return mOs != nullptr;
     }
+    void flush() {
+        if (mOs) {
+            mOs->flush();
+        }
+    }
 private:
     template<typename>
     friend class NullableOStream;