Don't chmod() if path is a symlink.
Issue #18292: Idle - test AutoExpand. Patch by Saihadhav Heblikar.
Merge heads.