add locks to atomtable, fix cython testcase