Fix inappropriate logouts on load-balanced Horizon

The session timeout code in the horizon/middleware.py can cause
inappropriate timeouts/logouts when running Horizon behind a load
balancer on two machines that are slightly out of sync time-wise.

Use timestamps rather than datetime as the arithmetic is simpler.

Closes-bug: #1243277
(cherry-picked from commit 13355dacdbfa9ef14a4e1c16afeffaece5c13a39,
 minus the unrelated settings.py changes.)

Change-Id: I23159d2dee7fc05653a99fc89fbfd4d52e988df5
Merge "Fix inappropriate logouts on load-balanced Horizon" into stable/havana