Fix a few memory leaks

Also guard against calloc failure in lakka_init.