Shrink input buffer in inflate-stream

The patch shrinks the input buffer of inflate stream, so that minimum data would kept within the decoder.

The issue is not trivial but has real-world impact; I have seen crashes due to the problem described in http://blog.kazuhooku.com/2013/11/do-not-allocate-typed-arrays-too.html , which is mitigate by the patch.