don't use reinterpret_cast, use dynamic_cast on objects with virtual inheritance

Another mac fix reported at #6770