backport of php upstream patch fix getrandom() call for images, deployed on kernel < 3.17 https://github.com/php/php-src/pull/2385