Vacuum excitation by sudden appearance and disappearance of a Dirichlet wall in a cavity