Safer rmtree - check with isdir first.