Handle and log errors when reading .dockercfg

Addresses issues mentioned in #1644