dispatcher error handling: only send 404 and 503 error codes if headers are not already sent

git-svn-id: http://www.pimcore.org/svn/pimcore/private/core/trunk@4497 1f8fe7d8-47f0-464c-8d0a-336f4953ab05