insertMasterDocs can now report all failures

This commit introduces a version of `insertMasterDoc` that can process
each document insertion separately and collect any exception thrown by
the DB layer, returning at the very end a list of failures (if any)
alongside the inserted documents.

Failures can then be logged and reported to the user and/or in the
server logs.
4 jobs for adinapoli/issue-476 in 67 minutes and 36 seconds (queued for 26 minutes and 36 seconds)
Status Job ID Name Coverage
  Cabal
passed #18369
cabal

00:29:11

 
  Stack
passed #18370
stack

00:04:20

 
  Bench
manual #18371
allowed to fail manual
bench
 
  Test
passed #18372
test

00:34:03