Fix empty document unserialization with PHP 5.4.29 / 5.5.13