Fix crash in CompatUtility::GetCheckResultPerfdata.

Refs #5026
Implement serializer support for arbitrary classes.

Fixes #5024