Improvements to middle-click closing files

Improved fix for #3889 (Middle click should close files)
- Don't go through normal selection-click handling codepath first: detect middle click in the same place we filter out close-button clicks. This means the file is closed instantly, as opposed to a delay while it's loaded / switched to first.  No longer need a separate middle-click listener as a result.
- Use constants for event.which
- Remove long-commented-out rename code
- Move misplaced comment ("might never have been opened") to its rightful home

@RaymondLim I think this conflicts a little bit with your advice in the original PR #3901, so maybe you could take a look?