Fix a faulty assert() in sqlite3BtreeBeginTrans() that may fail in shared-cache mode.
Obtain the required shared-cache write-lock when executing "DELETE FROM tbl" statements. Fix for [1e1321ee98].