In case folding a node end up with a NaN as operand for the select, the folding here fails because the comparison is "UNDEF". This patch handles the UNDEF accordingly.
There is no test case because I can find a situation in an open source backend where we would generate a NaN in DAGCombine (the folding is performed earlier during DAG creation usually). Yet it seems that generating a NaN is not invalid by itself.