Update references to localhost to be 127.0.0.1

* Not all hosts seem to have localhost mapped to 127.0.0.1
  (travis-ci?) in all environments.