Some rework on proc

- Improving mutual exclusion in proc
- Added mtx_test() and test_lock() functions for testing lock
- Moved PID randomization to proc_fork
- lastpid is no globally available