make stmtCacher thread-safe

Go maps aren't thread safe, adding a mutex to guard the map makes it thread-safe.