[#2164] Only reregister SelectionKeys that are still valid