fixed handling of proxies in UnitOfWork::purgeChildren

supersedes #224