make sure a failed json_encode always returns false

which the manual states, but 5.4 seems to return null instead...