Fix UniqueConstraintViolationException while insert into oc_file_locks
Fix UniqueConstraintViolationException while insert into oc_file_locks

* fixes #9305 by not being prone to the race condition in insertIfNotExists
* fixes #6899 by not using a query that can result in a deadlock
* replaces the insertIfNotExists call with an insert which is wrapped into a try-catch block
* followup to #12371

Signed-off-by: Morris Jobke <7f550a9f4c44173a37664d938f1355f0f92a47a7@morrisjobke.de>

andreas-p/nextcloud-server,andreas-p/nextcloud-server,nextcloud/server,nextcloud/server,nextcloud/server,andreas-p/nextcloud-server,andreas-p/nextcloud-server,andreas-p/nextcloud-server,nextcloud/server