Beta-binomial gradient with respect to its pi parameter

grad_pi(ms, ns, pi, theta, MemLim = 2048L, Xtra = 7L)