Close with timeout for write buffer