Added support for lock files to avoid running a command multiple in parallel when executing e.g. from crontab.