msc: Attempt to release the lchan immediately on IMSI Detach

The Nokia E71 sends a "IMSI Detach" this msc code does not immediately
send the "RR Channel Release", the E71 is impatient and sends a DISC,
the "RELEASE INDICATION" is handled by starting the channel release
procedure. OpenBSC sends a "RR Channel Release" which will never be
answered, during the early release there is no timer and the lchan will
be in "RELEASE REQUESTED" forever.

This commit removes the anchor operation and checks if the channel can
be released immediately. Regarding the channel release handling there
is already a branch that needs to be tested.
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index c6a5436..9bdc39c 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -916,10 +916,9 @@
 			_gsm48_rx_mm_serv_req_sec_cb, NULL);
 }
 
-static int gsm48_rx_mm_imsi_detach_ind(struct msgb *msg)
+static int gsm48_rx_mm_imsi_detach_ind(struct gsm_subscriber_connection *conn, struct msgb *msg)
 {
-	struct e1inp_sign_link *sign_link = msg->lchan->ts->trx->rsl_link;
-	struct gsm_bts *bts = msg->lchan->ts->trx->bts;
+	struct gsm_bts *bts = conn->bts;
 	struct gsm48_hdr *gh = msgb_l3(msg);
 	struct gsm48_imsi_detach_ind *idi =
 				(struct gsm48_imsi_detach_ind *) gh->data;
@@ -952,7 +951,7 @@
 	}
 
 	if (subscr) {
-		subscr_update(subscr, sign_link->trx->bts,
+		subscr_update(subscr, bts,
 				GSM_SUBSCRIBER_UPDATE_DETACHED);
 		DEBUGP(DMM, "Subscriber: %s\n", subscr_name(subscr));
 
@@ -966,7 +965,8 @@
 	/* FIXME: iterate over all transactions and release them,
 	 * imagine an IMSI DETACH happening during an active call! */
 
-	/* subscriber is detached: should we release lchan? */
+	release_anchor(conn);
+	msc_release_connection(conn);
 	return 0;
 }
 
@@ -1047,7 +1047,7 @@
 		release_loc_updating_req(conn);
 		break;
 	case GSM48_MT_MM_IMSI_DETACH_IND:
-		rc = gsm48_rx_mm_imsi_detach_ind(msg);
+		rc = gsm48_rx_mm_imsi_detach_ind(conn, msg);
 		break;
 	case GSM48_MT_MM_CM_REEST_REQ:
 		DEBUGP(DMM, "CM REESTABLISH REQUEST: Not implemented\n");