[server] Use single connection with DB for migrations
Summary:
Database migrations are performed wrapped in transactions that require single connection with database.
This diff fixes problem with deadlocks, that appeared when trying to update permissions for all threads, which was caused by using connection pool.
After the change, until all migrations are performed, only one connection to database is established.
Test Plan: Run multiple times migration from D4071, that caused problems with locks. The issue no longer appears.
Reviewers: palys-swm, atul, yayabosh, ashoat
Reviewed By: ashoat
Subscribers: ashoat, Adrian, yayabosh
Differential Revision: https://phab.comm.dev/D4514