lib: make write() accept a string argument

`stream.write("convert me")` now works. Previously, only buffers were
accepted.
lib: remove extraneous convert() argument
lib: fix double conversion in write()

The input buffer got converted twice. Not harmful but wasteful.