[query] only run nest_asyncio if asyncio is in use (#10364)
[query] only run nest_asyncio if asyncio is in use (#10364)

I do not fully understand why, but pytest sometimes imports Hail in threads
other than the main thread. Asyncio raises an error if you try to start an
event loop in a non-main thread.

This PR only runs nest_asyncio if there is already a running event loop. If
there is no running event loop, we do not need to run asyncio anyway! If
there is a running event loop, we can modify it to be nest-able even from
a non-main thread.
hail-is/hail,hail-is/hail,hail-is/hail,hail-is/hail,hail-is/hail,hail-is/hail,hail-is/hail,hail-is/hail