* lisp/mail/footnote.el: Use dolist and hoist regexps out of loops

(footnote--refresh-footnotes): Use pcase-dolist; compute regexp once
outside of the loops.  Use less confusing `literal` arg to `replace-match`
and specify `fixedcase` since footnote--index-to-string already chose
the proper case for us.
(footnote--renumber): Use dolist; compute regexp once
outside of the loops; shortcircuit when number is unchanged.
(footnote--text-under-cursor): Rewrite.
(footnote--make-hole): Use dolist.
(footnote-add-footnote): CSE.
(footnote-delete-footnote): Use dolist; compute regexp once
outside of the loop.
(footnote-delete-footnote): Don't renumber if there's no footnote left.
(footnote-renumber-footnotes): Use dolist.
1 job for master in 50 minutes and 16 seconds (queued for 3 seconds)
Status Job ID Name Coverage
  Test
failed #1614
test-all

00:50:16

 
Name Stage Failure
failed
test-all Test
make[2]: *** [check-doit] Error 1
Makefile:315: recipe for target 'check-doit' failed
make[2]: Leaving directory '/builds/emacs/emacs/test'
Makefile:290: recipe for target 'check-expensive' failed
make[1]: *** [check-expensive] Error 2
make[1]: Leaving directory '/builds/emacs/emacs/test'
Makefile:963: recipe for target 'check-expensive' failed
make: *** [check-expensive] Error 2
ERROR: Job failed: exit code 1