force permissions and delete ACLs if rmtree fails

This logic is ugly as the installation directory will be left
in a mangled state if it fails partway through.  However, the
same is true when `rmtree` fails partway through, which this
code is intended to minimize.

References: #5504
Merge pull request #5596 from rolandwalker/permissions_before_rmtree

force permissions and delete ACLs if `rmtree` fails