Improve replace-buffer-contents/replace-region-contents

* src/editfns.c (Freplace_buffer_contents): Add two optional arguments
  for mitigating performance issues.
* lisp/emacs-lisp/subr-x.el (replace-region-contents): Move from
  subr.el.  Add the same two arguments as for replace-buffer-contents.
* lisp/json.el (json-pretty-print-max-secs): New variable holding the
  default MAX-SECS value json-pretty-print passes to
  replace-buffer-contents.
  (json-pretty-print): Use it.
* doc/lispref/text.texi (Replacing): Add documentation for
  replace-buffer-contents two new optional arguments.  Document
  replace-region-contents.
1 job for master in 57 minutes and 43 seconds (queued for 3 seconds)
Status Job ID Name Coverage
  Test
failed #891
test-all

00:57:43

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