Permit clean shutdown when remote side terminates connection

Previously this would block.