fixes a locking issue and exception logging
Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0