Avoid NPE in ContextLoader when dealing with an untyped ApplicationContextInitializer

Issue: SPR-10449
(cherry picked from commit a19c976)
Consistent use of Class<?> in Assert
(cherry picked from commit 16548d2)