Making sure to check if we have an active output
buffer before trying to grab its contents, especially
for PHP-fpm, since `fastcgi_finish_request()` closes
all output buffers automatically

This fixes #163