Avoid a crash in SET_KEEPALIVE if the socket transport is not initialized.