Try to make external filters unloading less aggressive.

This commit fixes #3345 #3468.
Replace deprecated CoLoadLibrary/CoFreeLibrary calls by new API calls.