/* Remove and returns the head of queue. 
Dequeue is destructive so head will change to new head */
memq_link_t* memq_dequeue(memq_link_t *tail, memq_link_t **head, void **mem)
/* Remove and returns the head of queue. 
Dequeue is destructive so head will change to new head */
memq_link_t* memq_dequeue(memq_link_t *tail, memq_link_t **head, void **mem)
{
	memq_link_t *old_head;
	old_head = memq_peek(*head, tail, mem);
	if (old_head == NULL) {
		return NULL;
	}
	*head = old_head->next;
	return old_head;
}