ws: Fix use of Secure https only cookies

We now have various criteria on whether HTTPS is in use, not just
just whether a certificate is present or not. So make the 'Secure'
flag of cookies track those criteria, and just check if the
connection in use is a TLS connection or not.

In addition fail safe, so and don't use G_IS_TLS_CONNECTION() but
rather the inverse, and rename things, add tests, so if things
change in our TLS implementation this will be caught.

Closes #533