add rename

This avoids creating the target directory if the old and new path are
identical.