Time-symmetric integration of partial differential equations with applications to black hole physics