parallelize_mem: small cleanups
fix a bunch of memory leaks reported by coverity
add missing break