Fix mess with struct tbf types passed to LOGPTBF macro

It is quite common in all osmo-pcu code to have to convert between
parent class "tbf" and children "dl_tbf"/"ul_tbf", or other way around.
This commit adds new helper static inline functions to cast between
those while doing type checks.
This is used by new LOGPTBFDL and LOGPTBFUL macros to now expect the
proper subclass and cast securely inside the macro itself, hence sparing
all code calling those macros to have to cast explicitly the pointer to
the parent "tbf" class.

Change-Id: I7e4489ad4b93c9c8442213947e53c10b61fdc5e9
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 6598067..7094d40 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -535,7 +535,7 @@
 {
 	/* schedule polling */
 	if (pdch_ulc_reserve_tbf_poll(trx->pdch[ts].ulc, new_poll_fn, this, reason) < 0)
-		LOGPTBFDL(this, LOGL_ERROR, "Failed scheduling poll on PACCH (FN=%d, TS=%d)\n",
+		LOGPTBF(this, LOGL_ERROR, "Failed scheduling poll on PACCH (FN=%d, TS=%d)\n",
 			  new_poll_fn, ts);
 }