block while writing
block while writing

Make sure to wait until we're done writing before returning. The close should
interrupt this process but we should still wait.

might be related to https://github.com/ipfs/go-ipfs/issues/6197

libp2p/go-libp2p,libp2p/go-libp2p,ipfs/go-libp2p