Rotational averaging and optimization of laser-induced population transfer in molecules