Fix failures where 'git clean' fails but could be clobbered

Fixes #2677.