fix reading compressed binary terms from Java

Larger compressed binary could not be decoded inside JInterface.

- applied a patch posted on erlang-questins in September 2009
  http://erlang.org/pipermail/erlang-patches/2009-September/000478.html
-> extended this patch as it alone was not enough to fix the bug

Problem was that when reading from an InputStream, you can only specify a maximum number of bytes to read. Java doesn't quarantee that it actually reads this many bytes - it could be less!
This patch now reads up until the expected size bytes. If there are more than expected, the actual number of available bytes is not printed (we probably shouldn't read the additional bytes, security-wise - the erlang external byte representation is broken in this case though).
add (de)compress roundtrip tests with larger values
jinterface: don't need another FilterOutputStream wrapper

DeflaterOutputStream is already an FilterOutputStream
jinterface: fix typo in error message if encoding fails
jinterface, OtpOutputStream: properly override the three write() methods to ensure our growth strategy

Previously, if code called e.g. write(byte[] b, int off, int len), the growth strategy of the parent class ByteArrayOutputStream was used.
jinterface: don't compress small erlang terms < 5 bytes

Compression always has at least 5 bytes (the compressed tag + original size) so we can't get a smaller external term if the original term is already smaller than 5 bytes.
jinterface: don't return compressed external term if bigger than uncompressed

Now, OtpOutputStream#write_compressed() uses the same mechanism as erts_term_to_binary() in external.c: it tries to compress the given term into a buffer of the size of the uncompressed term and if this is not possible, i.e. the compression plus headers is bigger, it uses the uncompressed external term format instead.
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.