fix all build warnings

Most are unused variable.

Please review
* php_stat usage (fix: 'stat' may be used uninitialized in this function [-Werror=maybe-uninitialized]
* strerror_r usage (fix: ignoring return value of 'strerror_r', declared with attribute warn_unused_result [-Werror=unused-result])