Updated Linux support to not require sudo for whole script:

* Tidied up OS checking to match python docs
* Updated the linux specific code path to use a tmp copy of hosts and then copy it back. This allows us to only use gksudo for the copy, not the whole script.