Replace dynamic_cast with virtual functions.

apitrace can be built with without RTTI (runtime type information)
providing that dynamic_cast isn't used.

-----------------

Regal tries to keep C++ runtime library dependencies to a minimum for the purpose of portability.
Tracing works fine with these minor changes to eliminate the use of dynamic_cast.

- Nigel