cmaes: fixed activation of gradient function when available from within ROOT