Stability of hydrides in sub-Neptune exoplanets with thick hydrogen-rich atmospheres