jinterface: new limited OutputStream implementation without the need to resize

(saves memory re-allocations)
jinterface: fix a memory leak

after the first try to compress the value with a fixed buffer size, the deflater must be closed so that memory can be (instantly) reused
jinterface, OtpOutputStream: add a write_compressed(object, level) method

Now that we use an own deflater, we can also allow the user to specify the compression level as in Erlang's term_to_binary/2.