Redmine #5973: Fix bugs found in log errors

@ediosyncratic should review first commit, mostly to assert that my assumption about cf-hub receiving signals in its daily operation is correct.

@jimis should review second commit. I have not run the tests, because I get a failure in the ``tls_generic_test``, even in vanilla master. We should look into that before merging.