test: Make Helper methods thread safe

This can leak clients. [See here](https://github.com/flynn/flynn/blob/a8fb8b95d87334174bbcc3bcaaf9280b3ab0ee93/pkg/postgres/postgres.go#L102-L125) for an example of doing this correctly.