only update hosts file if it has changed - for both host and guest

Cleaner implementation of pull request #68

Thanks for the pointers!