auth: Handle REQUEST_URI not being authoritative

If _SERVER{REQUEST_URI} does not start with a leading slash, add one. This
will ensure that the redirect URL offered after a successful login will
be to an absolute url rather than an implied relative one.

Fixes osTicket/osTicket-1.7#858
Faster SQL-query, huge performance improvement on installations with thousands of tickets.
perf: Slight simplification of SQL tweak

'where 1' and 'where 1=1' gives me hives...
Merge pull request #861 from greezybacon/issue/858

auth: Handle REQUEST_URI not being authoritative

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #862 from greezybacon/issue/856

perf: Significant improvement fetching statistics

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge remote branch 'upstream-1.7/develop' into develop

Merge more upstream 1.7.3+ changes

Conflicts:
	main.inc.php