Fixed race condition in advanced-test.
fixed major memory leak in pdb2pka