use TopicStatistics only if available

@forouher Since `TopicStatistics` is only available in the latest ROS distro it must be checked if it is available.