Fix #5. Pass error to callback in _write.

This fixes a bug where the 'finish' event is improperly emitted from the
write stream when the write stream is invalid and should only emit an
'error' event.