Just use SHOW OPEN TABLES; if you find out In_use is greater than 0 then that table is locked ....
SHOW OPEN TABLES;
I think the command to unlock is UNLOCK TABLES
UNLOCK TABLES