Call remove_process_locks when a process ends, fix declarations.

3 files changed