Bugfix
Fixes the problem, that a task is not locked if it was initially locked when the script started, but another process released the lock in the meantime.
Fixes the problem, that a task is not locked if it was initially locked when the script started, but another process released the lock in the meantime.