Set 404 error code when using custom handler.

When using a custom not found handler, the http status code is not set to 404.