encoding: OBufferStream closes stream in destructor

This avoids use-after-free error from base class destructor.

refs #3727

Change-Id: Ie9abde981fe98dcb1bc541858ed03afbaae56ad1
diff --git a/src/encoding/buffer-stream.hpp b/src/encoding/buffer-stream.hpp
index b813e49..e7dc60f 100644
--- a/src/encoding/buffer-stream.hpp
+++ b/src/encoding/buffer-stream.hpp
@@ -72,6 +72,8 @@
 public:
   OBufferStream();
 
+  ~OBufferStream();
+
   /**
    * Flush written data to the stream and return shared pointer to the underlying buffer
    */