Add function to flatten LinkedList to array

Man, I've been needing this for a looong time, not sure what took me so long
to write this fairly trivial code.
freeLinkedList(NULL) no longer crashes
Add function to flatten LinkedList to array

Man, I've been needing this for a looong time, not sure what took me so long
to write this fairly trivial code.
Even more leaks fixed in the test cases...