adding timeout to cron lock file

fixes https://github.com/owncloud/core/issues/3221

This PR leaves the cron code almost untouched to allow backporting - if required/requested.

Overall the cron code needs refactoring to allow unit testing and proper code structure.

@PVince81 @MorrisJobke @Raydiation please review

@karlitschek @craigpg @MTRichards for your information