I got a similar "table locked" error in sqlite3 while trying to DROP a table which is the target of a foreign key configured in another table. So, if tableA has a foreign key specification toward tableB, then tableB cannot be dropped while tableA exists (or at least its Foreign key link).