[server] avoid creating multiple connection pools
Summary:
Solves problem described in ENG-1682.
When there are multiple dbQuery at one time also multiple loadPool() can run asynchronously, which lead to problem visible at this debug logs:
which means we call mysqlPromise.createPool(options) and assign it to pool when there is an already defined connection, as a result, we override the previous one which is not being closed and cause e.g. scripts not exiting.
Also, each spawned worker has a separate pool connection so this fix should work without additional synchronization.
Test Plan: Run script (e.g. rename-user.js since it begins with multiple asynchronous queries) and check if it will exit adequately.
Reviewers: tomek, atul, ashoat
Reviewed By: tomek
Subscribers: ashoat, atul, abosh
Differential Revision: https://phab.comm.dev/D5050