fixed resource check for multithreaded usage

If you use the logger in a multithreaded php application based on pthreads it will show up ```fwrite() expects parameter 1 to be resource, integer given``` when doing logs. This comes because a stream resource taken to a thread context won't be null. The fix is to do a explicit check if it isn't a resource. I'am on the integration of monolog to our [`PHP WebServer`](<https://github.com/techdivision/TechDivision_WebServer>) at the moment so it would be nice if you can accept that pull request shortly :)

Cheers!
Johann