Added a lockfile to the cron process and better error handling

OpenShift always starts the application in two
processes, which results in the cron task to
be executed twice. We are trying to avoid this
by using a lockfile.