Fix additional writes after reader ends.

Also fix callback when open finishes before first write flush.