Fix for job queue problems

There seems to be a problem, if a job / project has queued items waiting. Sometimes it will cause two resources to be locked, even if one resource is requested.

This pull request contains a fix to the problem.