Discrete Adjoint Sensitivities for the Real-Time Optimal Control of Large District Heating Networks During Failure Events