Resolves the "correct" classloader to use i.e.
Resolves the "correct" classloader to use i.e. chooses between the current classloader or the context classloader.
the logic is based on the JavaWorld article 'Find a way out of the ClassLoader maze' by Vladimir Roubtsov.