Make Boost.Test work with RTTI disabled (fixes #9228)

This commit fixes compilation on GCC with RTTI off