send 500 HTTP status code in case of database error

this allows you to track from accesslogs failed requests, and in case of
some frontend server, act accordingly if the status code is not correct

also makes search engines not to index your error pages!
Merge pull request #891 from glensc/500-header

send 500 HTTP status code in case of database error