consistent use of goto out in main

This fixes the not terribly important issue that valgrind would complain about not having called jq_teardown leaving some memory hanging around.