Handle exceptions thrown from unserialize similar to normal php
Handle exceptions thrown from unserialize similar to normal php

Most of this code was taken from ext/standard/vars.c:948, the error
message isn't the same, but that's just a small detail.

Funny enough you can actually make unserialize throw if you make this
code handling the same as serialize, but as the php documentation says
that unserialize doesn't throw we just handle it like this (the way we should).

sjinks/PHP-CPP,dreamsxin/PHP-CPP,sjinks/PHP-CPP,sjinks/PHP-CPP,CopernicaMarketingSoftware/PHP-CPP-LEGACY,CopernicaMarketingSoftware/PHP-CPP,sjinks/PHP-CPP,CopernicaMarketingSoftware/PHP-CPP-LEGACY,CopernicaMarketingSoftware/PHP-CPP,dreamsxin/PHP-CPP