Add profiling, clean up logging in throughput test.

Just running 'kvlayer_throughput_test' with appropriate arguments will
*only* print out the final performance stats; adding --verbose will print
many progress messages (debug-level logging).

Adding --profile will dump out a bunch of profile.* files, one per
multiprocessing worker, which you can review with
'python -m pstats profile.12345.txt'.
Use a connection pool for the PostgreSQL backend.

This fixes a problem where merge sorts running two scans on the same
connection object could fail when the earlier scan killed the later scan's
cursor.  It also passes responsibility for recovering from failed connections
back to the PsycoPG2 connection-pool library, which knows what to look for,
and correspondingly removes the need for the @detach_on_exception decorator.