Fix #2641: Input field change to blank after double click F2 to rename the file - few user will encounter

This adds a renaming flag, so that when F2 is pressed for the second time, the code does nothing, leaving the renaming as it was, which fixes issue #2641.