[optimize] count function evaluations in approximate jacobian for L-BFGS-B (Issue 2305)

Also a doc fix.