socket: revert `onclose` reason