Fix improper process termination handling. Fix coverage cleanup to use signal handlers (as coverage.py's handling does not cover those cases).