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/ulc/PdchUlcTest.err b/tests/ulc/PdchUlcTest.err
index 2995b69..bcc5779 100644
--- a/tests/ulc/PdchUlcTest.err
+++ b/tests/ulc/PdchUlcTest.err
@@ -18,8 +18,7 @@
 Creating MS object
 The MS object cannot fully confirm an unexpected TLLI: 0x12345678, partly confirmed
 MS(TLLI-0x12345678:TA-220:MSCLS-0-0) Attaching DL TBF: TBF(DL:TFI-0-0--1:STATE-NEW:GPRS:TLLI-0x12345678)
-MS(TLLI-0x12345678:TA-220:MSCLS-0-0): + ms_attach_dl_tbf: now used by 1 (ms_attach_dl_tbf)
-MS(TLLI-0x12345678:TA-220:MSCLS-0-0:DL): - ms_attach_dl_tbf: now used by 0 (-)
+MS(TLLI-0x12345678:TA-220:MSCLS-0-0:DL): + tbf: now used by 1 (tbf)
 PDCH(bts=0,trx=0,ts=0) Reserving FN 2715608 for type POLL
 PDCH(bts=0,trx=0,ts=0) Reserving FN 2715613 for type POLL
 PDCH(bts=0,trx=0,ts=0) Reserving FN 2715617 for type POLL
@@ -76,6 +75,7 @@
 PDCH(bts=0,trx=0,ts=0) Timeout for registered POLL (FN=39, reason=UL_ASS): TBF(DL:TFI-0-0--1:STATE-NEW:GPRS:TLLI-0x12345678)
 MS(TLLI-0x12345678:TA-220:MSCLS-0-0:DL) Destroying MS object
 MS(TLLI-0x12345678:TA-220:MSCLS-0-0:DL) Detaching TBF: TBF(DL:TFI-0-0--1:STATE-NEW:GPRS:TLLI-0x12345678)
+MS(TLLI-0x12345678:TA-220:MSCLS-0-0): - tbf: now used by 0 (-)
 PDCH(bts=0,trx=0,ts=0) PDCH state: disabled => enabled
 PDCH(bts=0,trx=0,ts=0) Reserving FN 104 for type SBA
 PDCH(bts=0,trx=0,ts=0) Reserving FN 117 for type SBA