add WriteSession.FlushHandler, unified WriteSession.reset()