Fixing two problems that I consider bugs.

This pull request attempts to fix the two problems that I consider bugs.

1. The way authentication information is stored accepts key like `docker.example.com`, but they are retrieved by full format like `https://docker.example.com/v1/`, which is quite confusing when using the module.
1. `ping` function will report the host being unresponsive even if the host returned `401 Unauthorized`, which can happen for private docker registries.

Please review and indicate ways to improve the code.