The naive estimator is biased. If there are $N$ trials and $i$ success, a Rao-Blackwellisation of the naive estimator gives the unbiased estimator $\frac{2l}{d}\left(\frac{n}{i}+\frac{1}{i}\right)$ (to be fair this hides an assumption for a uniform prior for the probability of p).

One can look at the variance of the estimator conditional on obtaining one success. The strategy is then to set $l=d$ (for n small enough, there may actually be a local minimum for a low value of $\frac{2l}{d\pi}$ but the formula seems intractable).