The proxy records an exchange in its Response hook, before the client gets
the response, and recordViews wrote the trigram index of each body (up to
4 MiB) inside its transaction while holding wmu. That is almost all of the
recording cost: a 1 MB minified script takes ~163 ms with the index and
~1 ms without, and every other request being recorded waits on wmu behind it.
Queue the index write instead and let one background worker do it.
Searches that use the index wait for everything queued before them, so a
body search still finds an exchange recorded before it. The worker only
writes an entry whose exchange still exists with the same rowid and id, so
a delete in between can't leave an entry that matches a later exchange.
The queue holds at most 16 bodies; a recorder waits when it is full.
Fixes#542.