implement close handshake for sync and copas