[Close Others] Fix #6019: Contextual Close Others menu entries

This is for #6019, it makes the Close Others context menu entries contextual so that they are dynamically disabled and enabled.