Topological Landau-Ginzburg theory with a rational potential and the dispersionless KP hierarchy