Add thread safety checker, make AmbiguityScore and Solver reentrant
Enable the thread safety checker, and make both algorithms reentrant. Had to remove the const_cast
: in any case, the pass-through mode of the Solver is a waste of CPU and is (hopefully) not getting used seriously anywhere. I can see that the setup would be useful for tests.