Fix flawed logic in JSON "serializer"

(because of course JSON is serialized by hand)
Merge branch 'exoscalefix' of github.com:exoscale/cloudstack into exoscalefix