controller: Fix hang in controller tests
controller: Fix hang in controller tests

The tests were haging during TestStreamDeployment, and I noticed that
pgx was blocking trying to acquire a connection. Looking at the code, we
were creating transactions before reading from the database, and so I
moved the transactions and it no longer hangs.

I don't know the specific reason this was an issue (I assume reading
inside a transaction is an ok thing to do?).

Signed-off-by: Lewis Marshall <748e1641a368164906d4a0c0e3965345453dcc93@lmars.net>

benbjohnson/flynn,lmars/flynn,benbjohnson/flynn,philiplb/flynn,benbjohnson/flynn,benbjohnson/flynn,flynn/flynn,flynn/flynn,benbjohnson/flynn,lmars/flynn,lmars/flynn,flynn/flynn,benbjohnson/flynn,lmars/flynn,flynn/flynn,lmars/flynn,flynn/flynn,philiplb/flynn,philiplb/flynn,philiplb/flynn,philiplb/flynn