Fix some memory corruption and related issues:

Initialize the arry for storing data to NULL values.
When insertint the first element in the queue, set the value of head to
0.
Properly increment the value of head.
Fix an off by one error in the for loop of cqueue_list.
cqueue_free should take a callback to free the data stored in the queue.