Comment 246 for bug 1512120

Created attachment 6978
Fix crash and hang while renaming (2)

@flocculant I have updated the patch - please test.