Three-Phase Fractional-Flow Theory of Foam-Oil Displacement in Porous Media with Multiple Steady States