Moving Lock() call in Rename

Rename is locking forever when the name is the same.