Fix deadlock condition: don't use same lock around counters and thread join. The deadlock occurred when vmtrim wanted to update counters while GDKexit was holding the lock when it was joining threads.
Fix deadlock condition: don't use same lock around counters and thread join.
The deadlock occurred when vmtrim wanted to update counters while
GDKexit was holding the lock when it was joining threads.

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