Free duplicated char* used for line subtokens
Free next pointers
Initialise bam_hdr_t RG and PG with NULL
Probably do well to free the header *after* trying to free the RG PG structures...
while curr not while curr->next!