introduce anonymous sub as shortcut to make the update_pkgs_retry code
readable
improve the update_pkgs_retry unittests to verify all arguments get
passed; and improve the checks for error logging