Check for already existing files and folder before rename.

Fixes #2560 
@devoncarew PTAL