redirect to secure url on domains that require secure submissions

also cache the lookup of whether a domain requires secure submissions
for 10 seconds.
Merge pull request #3186 from dimagi/redirect-to-secure

redirect to secure url on domains that require secure submissions