[NEXUS-7558] simple errors fix baseurl calculation

https://issues.sonatype.org/browse/NEXUS-7558

Encodes strings given to render error pages.

Aslo fixes baseUrl calculation which was messed up and not actually returning the proper base url when calculating from request.
Note that it's deprecated with the recommendation to use `sendError(int, String)` to send back status code + reason