Confinement of an electron in a non-homogeneous magnetic field: Integrable vs superintegrable quantum systems