Lock a process or a group of processes to a maximum of N simultaneous instances