Refining Diffusion Planner for Reliable Behavior Synthesis by Automatic Detection of Infeasible Plans