Fixed bug #50224 where float without decimals were converted to integer when encode to JSON

Refs #635
Actually, I've seen [another implementation](http://lxr.php.net/xref/PHP_TRUNK/ext/soap/php_encoding.c#1141) that seems to suggest that a size of `EG(precision) + MAX_LENGTH_OF_DOUBLE + 1` should work too.