httpd: fix warnings, more robust error handling, improved MIME handling