Verify runtime environment via 'self instanceof <worker interface>'

The runtime environment is detected by checking for the existence of
specific interface objects in the global object. E.g. the existence of
DedicatedWorkerGlobalScope in 'self' indicates that we are running
inside a dedicated web worker. In addition we now also check that the
global object is an instance of the relevent interface object so that
the test is resilient against browsers that expose all interface objects
in all contexts.
Add missing paranthesis