Create a WxEnd for messaging to a Worker or WorkerGlobalScope.

Note that even Window objects satisfy the WorkerLike interface, they should not be used with this function because messaging between Windows and Workers are different.

The worker will be terminated if the connection cannot be established. After the connection is established, the worker will be terminated when the WxEnd is closed.