Broaden the check introduced in 229975d61c7e5728ba to account for

"localhost.localdomain" patterns.

Perhaps `isPrefixOf "localhost"` would be desireable, instead?
Only bind to the localhost interface from REPL network socket.

Copied 'n pasted impl of
http://hackage.haskell.org/package/network-2.2.1.7/docs/Network.html#v:listenOn
modified to listen on localhost instead of iNADDR_ANY
Merge pull request #568 from LeifW/broaden_localhost_checking

Broaden localhost checking