static libevent/curl support; adjusting file_exists behavior for php files; bugfixes

I think the commit messages are all self-explaining:
Two commits are real bugfixes (one for the issue #319 and one if you compile without __thread TLS support) and the other two commits just make it easier to deploy a compiled project.