(__socket): Fix error code handling.