Fixed unfreed memory in module.c and exp.c
Let mopher die if PID file can't be written