grab lock during destruction
Merge pull request #391 from linas/master

grab lock during destruction