(maint) Only create serialization methods on objects supporting it

Without this patch to_pson was created on for example
Puppet::SSL::Certificate which doesn't actually have a to_data_hash
method causing faces to try to render them as PSON and failing, instead
of rendering them as String which works.