Optimal control of stimulated Raman adiabatic passage in a superconducting qudit