Greatly improve multi-threaded performance by keeping the connections lock only when preparing a statement, not while executing it (oops).