Factorization of in-medium parton branching beyond the eikonal approximation