fix even more memory leaks on mpirun
THESE ARE MOSTLY UGLY HACKS THAT MUST BE REVIEWED