[#40] Added synchronizing lock checking
[#40] SQL parser is now reentrant

Lots of tests fail and I don't want to even think about the memory
leaks...