Leicestershire inch into slender lead with prospect of setting a challenging fourth-innings target