add missing include for pid_t
Make the syscall lock be per syscall instead of global.