Avoid segfault if type is not a class

This simple fix for a segfault caused by a dereference of a null pointer fixes five failing unit tests, two in CondCore/DBCommon, and three in CondCore/ORA.
Please merge as soon as convenient.