Add a real-world test using threads

Run a bunch of threads each incrementing a shared counter, retrying on
ConcurrentUpdates. The count should not become corrupted.

Requires postgres, because sqlite in-memory databases can't be shared
between threads.