add onerror handler to all shutil.rmtree invocations

also some linting