Get value of t_start as late as possible

t_start is the time the cookie is set, so get it as close to the
time when we set the cookie as possible
Only overwrite referrer if this is an unload call

We check the referrer many times for browsers that don't support
navtiming.  For this to work, we need the referrer to be correct until
after we've read the start time correctly.  To make sure this works, we
set the referrer only in the unload handler.
Click might happen up to 15ms before unload

When checking if the current URL is the same as the clicked URL of the
previous page, we should allow some grace period for the time between
click and unload.  15ms seems appropriate since it's the least count for
the JS timer on Windows so we're unlikely to get something smaller than
that.

This solves an issue with going from HTTP to HTTPS since referrers are
hidden for privacy reasons.