Add interrupt guards around closeStream
Update closeStream to handle writable streams

Also stubs out flush