Release the long collection lock when we find a conflict.
Release the long collection lock when we find a conflict.

When a thread updates a document, it does the following (among much
else):
down_sema(updateBarrier);
set_lock(COLL_LONGLOCK);
commit
unset_lock(COLL_LONGLOCK);
up_sema(updateBarrier);

When three threads try this simultaneously, only the first does a
sema_down, the others skip this bit (using a counter).  The first
thread succeeds with the update.  The up_sema is also only done by the
last concurrent thread.

The second thread gets the lock (it skips the down_sema) and then
finds that there is a conflict, so it aborts, setting a flag that
queries have to be done sequentially.  This flag triggers that all
threads will now attempt a down_sema on the updateBarrier.

The first (when it does a second updating query) and second thread
will now proceed to this down_sema and hang there.

The third thread still hangs in the set_lock.

The problem that is solved here is that the second thread, when it
aborted the commit, kept the lock.  We now unset the lock, so that
thread three can continue and eventually do an up_sema which will make
that threads one or two can go past the down_sema they are hanging on.

zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb