Adding a check if the respective pkg.upgrade cmd fails.
Fixing lint issue in pkgpng.  Reverting changes in brew.py because of unit tests failures.
Merge pull request #14812 from garethgreenaway/pkg_upgrade_fail_check

Changes to pkg related modules and pkg state