Linear perturbations of matched spacetimes: the gauge problem and background symmetries