Replace the global counter lock with individual (per syscall) locks