[WSGI] Handle DB errors in permalink scripts as in search scripts