Hydrodynamic and hydromagnetic stability of black holes with radiative transfer