Fixed an issue where lines could be wrongfully removed

I'd add something like `log.debug("Removing entries from hosts file: %s", ",".join(rejected))`  or something along those lines. Would help if we ever need to track issues like this again.