log fatal errors using a shutdown function

like described here: http://stackoverflow.com/questions/277224/how-do-i-catch-a-php-fatal-error

additionally set display_errors to false as we output an error message ourself now.
Only do that if error log is enabled (ie on production)
in shutdown function current working directory is set to /

this fixes cache usage during error logging and rendering
support logging memory_limit error by further increasing the memory limit
Merge pull request #126 from nsams/log-fatal-errors

log fatal errors using a shutdown function