prevent concurrent use of insert prepared statemnt

Problems addressed:
1) two threads can use try to use the insert prepared statement at the same time.
2) if extra varies from call to call, a thread can end up with the wrong extra applied (race condition).