Fix #7944 add check/test for localhost in ParseHost

Fixes #7944, adds a test case for `addr` set to `localhost:5000`.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
I mean other people could potentially use the package although I know that's not the use case, but I use/used the units pkg all the time in other projects. Plus, it feels a little odd to move the default API constants to a pkg.