On the hydrodynamic and magnetohydrodynamic stability of an inclined layer heated from below