Uprading OwnCloud: Fixing 'could not acquire lock' error

While upgrading OwnCloud to version 8.1, I experienced strange errors:


This is a companion discussion topic for the original entry at https://www.xltoolbox.net/blog/2015/07/uprading-owncloud-fixing-could-not-acquire-lock-error.html