pub async fn close<S: AsyncWrite + Unpin>(stream: &mut S) -> Result<()>
Gracefully close after flushing accepted writes.