detect global "self" object of web workers (fixes #41)