Avoid invalid downcasts in DerivedFrom() vs. GetRegisteredIn()

...where SwFmt::DerivedFrom() is defined as

  return (SwFmt*)GetRegisteredIn();

and at least some tests like CppunitTest_sw_htmlexport ran into comparisons
(evaluating to false anyway) against DerivedFrom() for SwFmt instances whose
pRegisteredIn is merely set to a SwModify, not an SwFmt, via

  pDepend->pRegisteredIn = this;

toward the end of SwModify::Add (sw/source/core/attr/calbck.cxx).

Change-Id: I5de59c938b7f40bb9744df5189285fa5e1d5abd7