Driven vortices in three-dimensional layered superconductors: Dynamical ordering along the c axis