Regression tests for LOCK TABLE.

Robins Tharakan, reviewed by Szymon Guz, substantially revised by me.