Auto-flush writer

- ObjectWriter.Flush() is now called automatically after the top-level
WriteEndObject.
- Removed explicit Flush() calls from unit tests.