Efficient Computation of Longitudinal Lasing Modes in Arbitrary Active Cavities: The Bidirectional Time Evolution Method