Fix native codecs

Fix inflate.js error handling, according to nahidakbar in issue #101
inflate|deflate.js: report error by throwing Error.
This is a special case of the Z_BUFF_ERROR case. It is only an error if z.avail_in is nonzero.
Or so I read in some stack overflow comment. I could be wrong.