Fixed issues with UnchunkedHttpURLWriter

* Added missing closed and flushed sentinel assignments
* Added writer.flush() call to flush() to prevent 'insufficient data' on close