Time-dependent spectral functions of the Anderson impurity model in response to a quench and application to time-resolved photoemission spectroscopy