Fix: Infinite locking on deadlock checking of queryExec and queryInsert.