Non-Hermitian shortcut to adiabaticity of two- and three-level systems with gain and loss