fix printfh/sayfh bug (segfault on linux)

This properly closes filehandles under some circumstances. Before
we had a garbled req in the active_queue ov the libuv loop, which
could not be uv_close'd. After malloc-ing write requests and un-
referening these in the write callback, the requests in the queue
are safe to be closed.