Free command before exiting.

When we reach the max options, we need to increment before free'ing,
that way we don't end up trying to free data we haven't set which causes
a segfault.
Merge pull request #12 from larzconwell/fix_mem_leaks

Free memory when exiting the process.