Continuous-variable quantum key distribution in non-Markovian channels