Fix bug in rename() that occures if new filename starts with the old filename