Fix native codecs

Fix inflate.js error handling, according to nahidakbar in issue #101
inflate|deflate.js: report error by throwing Error.
Why are you throwing an error instead of returning -1?