In some cases, a class type can have a definition, but its destructor
may not yet be known. In that case, a segfault can occur in
EmitObjectDelete.
Avoid it by checking the return value of CXXRecordDecl::getDestructor,
and add a minimized test case.
Fixes PR36749.