flush ObjectOutputStream header to prevent blocking