atomspace: fix deadlock

This cures issue #393