ensure that the generator is valid before calling next

HHVM raises an exception when calling `next()` on a "empty" generator (see https://travis-ci.org/krtek4/php-quickcheck/jobs/40710346)

This commit tries to ensure that we still have values before calling next().