print error to STDERR only if sapi is cli or cgi

remake a pull request against the xdebug_2_2 branch.

---

Hi.

PHP is error output to STDERR only if sapi is cli or cgi.

But, xdebug do output to STDERR, independent of sapi, if display_errors is stderr.

As with PHP should check sapi.

[PHP main.c php_error_cb()](https://github.com/php/php-src/blob/master/main/main.c#L1078)