Refactor sbws exit checking so it is consistent
Based on
https://trac.torproject.org/projects/tor/ticket/28458#comment:9