Handle permissions corner cases on uninstall

* unset BSD file flags if present
* attempt ownership change if permissions changes fail

fixes #6699
fixes #6752
Merge pull request #6947 from rolandwalker/chflags_permissions

Handle permissions corner cases on uninstall