Fix schedule maxrunning logic

Fix for issue #12340. This changes the schedule logic to include the job name in the proc file using the `schedule` key and uses this, instead of the function name, to determine if the job is already running.