sockets now wait for any pending write or read operations to finish before destructing