Fix instrumentation of multiple database connections.

Python requires a function call to create a new scope; lambdas don't
create closures!

Fix #457.