Make curl follow docker.io redirect.

Fixed #4569