Caused by bug 26993. I think this is because the db rev drops the UNIQUE KEY itemnumber from items_last_borrower using SET FOREIGN_KEY_CHECKS=0 to bypass MySQL's protection against dropping an index that backs a FK constraint. This leaves items_last_borrower_ibfk_1 intact in metadata but without a supporting index, causing all item deletions to fail with error 1451 even if items_last_borrower is empty.
*** This bug has been marked as a duplicate of bug 42068 ***