Generalized dark-state polaritons for photon memory in multilevel atomic media