CA-87758: When handling an HTTP request, perform any logins/logouts on the master.

Previously we always attempted all logins and logouts via an RPC call
to localhost - the logouts would fail silently on a slave, causing a
session leak.

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #1324 from zli/xenserver/obelix/HFX-481

Obelix/HFX-481