TLS-related fixes from Stream DNS and Loop Manager branches
This merge request contains a couple of small, one line fixes which were proven to have positive effects in both Stream DNS and, later, Loop Manager branches. Thus, these are worth backporting.
Edited by Ondřej Surý