Fix EZP-23499: Fatal error removing class with unexistant datatype.

JIRA: https://jira.ez.no/browse/EZP-23499

This prevents a PHP fatal error when removing a class (contentType) if a datatype has been removed.
Instead, it is logged to error.log

Here you're checking with "==" (type flexible), but above with "!==" (strict). I'd expect both to be strict, or both to be non-strict. Or, how about doing instanceof checks in both cases?