ms: Rewrite MS release lifecycle

This commit changes lots of stuff in the MS release lifecycle, but
there's no really good way to split this into patches which make sense,
since all the chaos is intensively entangled.

Get rid of the ms_callback complex mess, it is not needed at all.

Previous MS release was strange due to the existance of previous
ms_callback.idle concept and MS storage: the MS signalled when it went
idle (no TBFs attached) and waited for somebody outside to free it,
while then arming itself the release timer to release itself if it was
not released by whoever.

The new lifecycle follows an easier (expected) approach: Whenever all
TBFs become detached from the MS and it becomes idle (use_count becomes
0), then it frees its reserved resources (TFI, etc.) and either:
* frees itself immediatelly under certain conditions (release timeout
  configured = 0 or MS garbage with TLLI=GSM_RESERVED_TMSI)
* Arms release_timer and frees itself when it triggers.

If during release_timer the MS is required again (for instance because a
new TBF with TLLI/IMSI of the MS is observed), then a TBF is attached to
the MS and it is considered to become active again, hence the release_timer
is stopped.

OS#6002
Change-Id: Ibe5115bc15bb4d76026918adc1be79469c2f4839
diff --git a/tests/app_info/AppInfoTest.err b/tests/app_info/AppInfoTest.err
index 3303ee8..a0a1d97 100644
--- a/tests/app_info/AppInfoTest.err
+++ b/tests/app_info/AppInfoTest.err
@@ -24,8 +24,7 @@
 PDCH(bts=0,trx=0,ts=6) Attaching TBF(DL:TFI-0-0-0:STATE-NEW:EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001.
 PDCH(bts=0,trx=0,ts=7) Attaching TBF(DL:TFI-0-0-0:STATE-NEW:EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001.
 MS(TA-220:MSCLS-10-11) Attaching DL TBF: TBF(DL:TFI-0-0-0:STATE-NEW:EGPRS)
-MS(TA-220:MSCLS-10-11): + ms_attach_dl_tbf: now used by 1 (ms_attach_dl_tbf)
-MS(TA-220:MSCLS-10-11:DL): - ms_attach_dl_tbf: now used by 0 (-)
+MS(TA-220:MSCLS-10-11:DL): + tbf: now used by 1 (tbf)
 ws(64)
 Creating MS object
 Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 12
@@ -36,8 +35,7 @@
 PDCH(bts=0,trx=0,ts=5) Attaching TBF(DL:TFI-0-0-1:STATE-NEW:EGPRS), 2 TBFs, USFs = 00, TFIs = 00000003.
 PDCH(bts=0,trx=0,ts=6) Attaching TBF(DL:TFI-0-0-1:STATE-NEW:EGPRS), 2 TBFs, USFs = 00, TFIs = 00000003.
 MS(TA-220:MSCLS-12-13) Attaching DL TBF: TBF(DL:TFI-0-0-1:STATE-NEW:EGPRS)
-MS(TA-220:MSCLS-12-13): + ms_attach_dl_tbf: now used by 1 (ms_attach_dl_tbf)
-MS(TA-220:MSCLS-12-13:DL): - ms_attach_dl_tbf: now used by 0 (-)
+MS(TA-220:MSCLS-12-13:DL): + tbf: now used by 1 (tbf)
 ws(64)
 
 --- test_sched_app_info_ok ---
@@ -65,9 +63,11 @@
 PDCH(bts=0,trx=0,ts=6) Detaching TBF(DL:TFI-0-0-0:STATE-NEW:EGPRS), 2 TBFs, USFs = 00, TFIs = 00000003.
 PDCH(bts=0,trx=0,ts=7) Detaching TBF(DL:TFI-0-0-0:STATE-NEW:EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001.
 MS(TA-220:MSCLS-10-11:DL) Detaching TBF: TBF(DL:TFI-0-0-0:STATE-NEW:EGPRS)
+MS(TA-220:MSCLS-10-11): - tbf: now used by 0 (-)
 MS(TA-220:MSCLS-10-11) Destroying MS object
 PDCH(bts=0,trx=0,ts=4) Detaching TBF(DL:TFI-0-0-1:STATE-NEW:EGPRS), 1 TBFs, USFs = 00, TFIs = 00000002.
 PDCH(bts=0,trx=0,ts=5) Detaching TBF(DL:TFI-0-0-1:STATE-NEW:EGPRS), 1 TBFs, USFs = 00, TFIs = 00000002.
 PDCH(bts=0,trx=0,ts=6) Detaching TBF(DL:TFI-0-0-1:STATE-NEW:EGPRS), 1 TBFs, USFs = 00, TFIs = 00000002.
 MS(TA-220:MSCLS-12-13:DL) Detaching TBF: TBF(DL:TFI-0-0-1:STATE-NEW:EGPRS)
+MS(TA-220:MSCLS-12-13): - tbf: now used by 0 (-)
 MS(TA-220:MSCLS-12-13) Destroying MS object