removed handle on appdomains before unloading, made the whole core more stable for concurrency errors (#467)