Changes how the execution plan cache handles concurrency

The old solution used lazy values to make sure two threads would not
do double work and parse and plan the same query. This is now changed
so that we allow a small window when multiple threads could end up
building the same thread. The benefit is that once a plan is in the
cache, no concurrency handling is needed to get it out.
Merge pull request #1233 from systay/cache-concurrency

Cache concurrency