Improved resource resolver thread handling to prevent thread leaks