Fix some warnings from MPICH

Thanks to Pavan Balaji for the report.
core: simplify the code displaying out-of-order discovery error messages