Allow X-Forwarded-Port header to override the default SERVER_PORT when reversing URLs

Related: https://code.djangoproject.com/ticket/19517