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)
It's possible I'm misunderstanding this code, but is defaultHost ever not 127.0.0.1? I'm wondering if we should make that a constant if that's the case. At least, we should have a test when defaultHost is not 127.0.0.1 with these same assertions.