Fixed a crash when creating relationships. Apparently this crash was
caused by a faulty access on some threads right after close the
relationship dialog. (issue #528)