Lateral surface magnetoplasmon in a semiconductor superlattice and edge magnetoplasmon in a two-dimensional electron gas