Fixed classloading if classes are not in the default classloader but tccl (backport)

Found by analysing play app