Lock all MySQL tables.

Turns out that if we want to update any tables, we need to lock them, too. So
just lock them all.

Also, tweak the invalid database error message to be more correct.