When serializing to a stream, flush its stream writer when finished.
Fixes #27.
Merge pull request #28 from QuickenLoans/stream_bug

When serializing to a stream, flush its stream writer when finished