Catch Serialization Exception in MediaWikiTestCase

In the case that something is not serializable then
we should fall back and just set the value.

This is the case for Closures..
See
http://wikidata-jenkins.wmflabs.org/ci/job/wikidata-client-tests/748/console

Change-Id: Ib5f76932d60840a2f97671c134e18adc619974cd
Merge "Catch Serialization Exception in MediaWikiTestCase"