libgtp: Remove packets in tx queue belonging pdp being freed

Doing so should avoid the crash seen in OS#3956, where a message is
received in osmo-sgsn gtp iface after having received a DeleteCtxAccept
message where pdp and associated cbp is freed. As a result, when new
confirmation arrives, it can still be matched against an old request and
be sent to upper layers providing an already freed cbp.

With this patch, since all queued messages belonging to that pdp are
dropped, confirmation won't find a match and be discarded in libgtp.

In order to be able to drop all req messages belonging to a pdp, a new list
is added to pdp_t and qmsg_t are added to that list when inserted into the per-gsn
req transmit queue. This way upon pdp free time it's simply a
matter of iterating over that list to remove all messages.

There's no need to do same for resp queue, and it'd be actually
counter-productive, because it wouldn't be possible to detect and
discard duplicates anymore after pdp ctx has been freed.

Related: OS#3956
Change-Id: Id86d0b241454d3ad49c64c28087fd2710fa2d17a
diff --git a/gtp/queue.h b/gtp/queue.h
index 76cb7be..9b0367b 100644
--- a/gtp/queue.h
+++ b/gtp/queue.h
@@ -17,6 +17,8 @@
 #ifndef _QUEUE_H
 #define _QUEUE_H
 
+#include <osmocom/core/linuxlist.h>
+
 #include "gtp.h"
 
 #define QUEUE_DEBUG 0		/* Print debug information */
@@ -39,6 +41,7 @@
 	int this;		/* Pointer to myself */
 	time_t timeout;		/* When do we retransmit this packet? */
 	int retrans;		/* How many times did we retransmit this? */
+	struct llist_head entry; /* Listed with other qmsg_t belonging to a pdp_t->qmsg_list_req */
 };
 
 struct queue_t {