[BZ-1013644][BZ-1011420] make internal class loader to work with ibm jvm
(cherry picked from commit ff7e0c62048fe46be73ed2b752d31ae8b8e80e58)