pw_transfer: Set event loop unconditionally

Do not rely on automatic event loop registration on the main thread
and set event loop even if the current thread is the main thread.

If the pw_transfer.Manager is created after an event loop attached to
the main thread is closed, the new event loop is not automatailly
registered for the main thread, which leads to the "RuntimeError:
There is no current event loop" exception in the pw_transfer.Manager
constructor on the main thread.

Change-Id: I1f5a906656668cdd9b872fa0ef4350b18413e363
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/106831
Commit-Queue: Dmitry Kotov <dkotov@google.com>
Reviewed-by: Carlos Chinchilla <cachinchilla@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
diff --git a/pw_transfer/py/pw_transfer/client.py b/pw_transfer/py/pw_transfer/client.py
index 30d7d86..da85b58 100644
--- a/pw_transfer/py/pw_transfer/client.py
+++ b/pw_transfer/py/pw_transfer/client.py
@@ -74,9 +74,8 @@
         self._write_stream: Optional[BidirectionalStreamingCall] = None
 
         self._loop = asyncio.new_event_loop()
-        # If constructed from non-main thread, set the event loop.
-        if threading.current_thread() is not threading.main_thread():
-            asyncio.set_event_loop(self._loop)
+        # Set the event loop for the current thread.
+        asyncio.set_event_loop(self._loop)
 
         # Queues are used for communication between the Manager context and the
         # dedicated asyncio transfer thread.