Get snaks in ReferenceSerializer from cloned $reference

otherwise, perhaps due to a strange php bug, $reference->getHash()
causes corruption sometimes, with reference becoming:

object(Wikibase\DataModel\Reference)#12673 (1) {
          ["snaks":"Wikibase\DataModel\Reference":private]=>
		      int(7518994243564923343)

then $reference->getSnaks() returns this integer and then
it is passed to ByPropertyListSerializer which expects an
object. If not an object, an exception is thrown.

Bug: 71519
Change-Id: Ia1e8e459045e4e9e4693e8974529287cc751df37
Merge "Get snaks in ReferenceSerializer from cloned $reference"