lib: fix streams API deviations

Fix two deviations from the streams API:

* Emit an 'end' event. Expected by some libraries.
* Make Iconv#end() accept an optional `input` parameter.

Fixes #67.