tbf: Implement delayed release of a downlink TBF

Currently a DL TBF is immediately closed, when the LLC queue is
drained. This will lead to a new DL assignment if data is received
afterwards. In addition, it is not possible to keep the PACCH open
to poll the MS for UL establishment requests there.

GSM 44.060, 9.3.1a suggests to delay the release of an inactive TBF
for some time (max 5s).

This commit mainly changes create_new_bsn() to send LLC dummy
commands as filler if no LLC data is available until keep_open()
returns false. The keep_open() functions returns true unless a
configurable time has passed after the LLC data store drained. By
default, that time is not set which causes keep_open() to always
return false, so that delayed release is effectively disabled.

The following VTY commands are added:
  - dl-tbf-idle-time <1-5000>    to set the delay in ms
  - no dl-tbf-idle-time          to disable delayed release

Ticket: #556
Sponsored-by: On-Waves ehf
diff --git a/src/tbf.h b/src/tbf.h
index ca5fedf..17ba980 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -326,6 +326,8 @@
 	bool need_control_ts() const;
 	bool have_data() const;
 	int frames_since_last_poll(unsigned fn) const;
+	int frames_since_last_drain(unsigned fn) const;
+	bool keep_open(unsigned fn) const;
 
 	bool is_control_ts(uint8_t ts) const {
 		return ts == control_ts;
@@ -344,6 +346,7 @@
 	uint8_t m_wait_confirm; /* wait for CCCH IMM.ASS cnf */
 	bool m_dl_ack_requested;
 	int32_t m_last_dl_poll_fn;
+	int32_t m_last_dl_drained_fn;
 
 	struct {
 		struct timeval dl_bw_tv; /* timestamp for dl bw calculation */