sync.WorkGroup: Provide "with" support

So that it becomes possible to write

    with WorkGroup(ctx) as wg:
        wg.go(f1)
        wg.go(f2)

instead of

    wg = WorkGroup(ctx)
    defer(wg.wait)
    wg.go(f1)
    wg.go(f2)

or

    wg = WorkGroup(ctx)
    wg.go(f1)
    wg.go(f2)
    wg.wait()

This is sometimes handy and is referred to as "structured concurrency"
in Python world.

sync.Sema, sync.Mutex, sync.RWMutex already support "with".
sync.WaitGroup is imho too low-level, but we might consider adding
"with" support for it in the future as well.

In general pygolang way is to use defer instead of plugging all classes
with __enter__/__exit__ "with" support, but for small well-known class of
concurrency-related things its seems "with" support is worth it:

- having "with" for sync.Mutex+co allows it to be used as a drop-in
  replacement instead of threading.Lock+co, and
- having "with" for sync.WorkGroup - the most commonly-used tool to
  spawn jobs and wait for their completion - makes it on-par with
  "structured concurrency".

/reviewed-on !12
121 jobs for master in 0 seconds
Status Job ID Name Coverage
  External
failed Pygolang.UnitTest-Master.Python2

00:01:26

passed Pygolang.UnitTest-Master.Python3

00:01:40

passed Pygolang.UnitTest-Master.Python2

00:01:12

passed Pygolang.UnitTest-Master.Python2

00:01:04

passed Pygolang.UnitTest-Master.Python2

00:01:11

passed Pygolang.UnitTest-Master.Python2

00:01:11

passed Pygolang.UnitTest-Master.Python2

00:01:13

passed Pygolang.UnitTest-Master.Python2

00:01:10

passed Pygolang.UnitTest-Master.Python2

00:30:02

passed Pygolang.UnitTest-Master.Python2

00:01:07

passed Pygolang.UnitTest-Master.Python2

00:01:09

passed Pygolang.UnitTest-Master.Python2

00:01:03

passed Pygolang.UnitTest-Master.Python2

00:01:11

passed Pygolang.UnitTest-Master.Python2

00:01:06

passed Pygolang.UnitTest-Master.Python2

00:01:06

passed Pygolang.UnitTest-Master.Python2

00:01:05

passed Pygolang.UnitTest-Master.Python2

00:01:07

passed Pygolang.UnitTest-Master.Python2

00:01:06

passed Pygolang.UnitTest-Master.Python2

00:01:12

passed Pygolang.UnitTest-Master.Python2

00:01:05

passed Pygolang.UnitTest-Master.Python2

00:01:10

passed Pygolang.UnitTest-Master.Python2

00:01:06

passed Pygolang.UnitTest-Master.Python2

00:01:13

passed Pygolang.UnitTest-Master.Python2

00:01:05

passed Pygolang.UnitTest-Master.Python2

00:01:07

passed Pygolang.UnitTest-Master.Python2

00:01:06

passed Pygolang.UnitTest-Master.Python2

00:01:09

passed Pygolang.UnitTest-Master.Python2

00:01:06

passed Pygolang.UnitTest-Master.Python2

00:01:45

passed Pygolang.UnitTest-Master.Python2

00:01:05

passed Pygolang.UnitTest-Master.Python2

00:01:36

passed Pygolang.UnitTest-Master.Python2

00:01:03

passed Pygolang.UnitTest-Master.Python2

00:01:07

passed Pygolang.UnitTest-Master.Python2

00:01:08

passed Pygolang.UnitTest-Master.Python2

00:01:32

passed Pygolang.UnitTest-Master.Python2

00:01:05

passed Pygolang.UnitTest-Master.Python2

00:01:05

passed Pygolang.UnitTest-Master.Python2

00:01:04

passed Pygolang.UnitTest-Master.Python2

00:01:18

passed Pygolang.UnitTest-Master.Python2

00:01:06

passed Pygolang.UnitTest-Master.Python2

00:01:14

passed Pygolang.UnitTest-Master.Python2

00:01:13

passed Pygolang.UnitTest-Master.Python2

00:01:14

passed Pygolang.UnitTest-Master.Python2

00:01:07

passed Pygolang.UnitTest-Master.Python2

00:01:13

passed Pygolang.UnitTest-Master.Python2

00:01:13

passed Pygolang.UnitTest-Master.Python2

00:01:05

passed Pygolang.UnitTest-Master.Python2

00:01:16

passed Pygolang.UnitTest-Master.Python2

00:01:30

failed Pygolang.UnitTest-Master.Python2

00:02:37

passed Pygolang.UnitTest-Master.Python2

00:01:54

passed Pygolang.UnitTest-Master.Python2

00:01:09

passed Pygolang.UnitTest-Master.Python2

00:01:21

passed Pygolang.UnitTest-Master.Python2

00:01:12

passed Pygolang.UnitTest-Master.Python2

00:01:08

passed Pygolang.UnitTest-Master.Python2

00:01:11

failed Pygolang.UnitTest-Master.Python2

00:01:40

passed Pygolang.UnitTest-Master.Python2

00:01:34

passed Pygolang.UnitTest-Master.Python2

00:01:35

passed Pygolang.UnitTest-Master.Python3

00:02:11

passed Pygolang.UnitTest-Master.Python3

00:01:46

passed Pygolang.UnitTest-Master.Python3

00:01:46

passed Pygolang.UnitTest-Master.Python3

00:01:25

passed Pygolang.UnitTest-Master.Python3

00:01:50

passed Pygolang.UnitTest-Master.Python3

00:01:24

passed Pygolang.UnitTest-Master.Python3

00:01:09

passed Pygolang.UnitTest-Master.Python3

00:01:10

passed Pygolang.UnitTest-Master.Python3

00:01:07

passed Pygolang.UnitTest-Master.Python3

00:01:09

passed Pygolang.UnitTest-Master.Python3

00:01:11

passed Pygolang.UnitTest-Master.Python3

00:01:55

passed Pygolang.UnitTest-Master.Python3

00:01:15

failed Pygolang.UnitTest-Master.Python3

00:01:23

passed Pygolang.UnitTest-Master.Python3

00:01:18

passed Pygolang.UnitTest-Master.Python3

00:01:22

passed Pygolang.UnitTest-Master.Python3

00:01:18

passed Pygolang.UnitTest-Master.Python3

00:01:42

passed Pygolang.UnitTest-Master.Python3

00:01:14

passed Pygolang.UnitTest-Master.Python3

00:01:12

passed Pygolang.UnitTest-Master.Python3

00:01:32

passed Pygolang.UnitTest-Master.Python3

00:01:09

passed Pygolang.UnitTest-Master.Python3

00:01:23

failed Pygolang.UnitTest-Master.Python3

00:02:01

passed Pygolang.UnitTest-Master.Python3

00:01:20

passed Pygolang.UnitTest-Master.Python3

00:01:13

passed Pygolang.UnitTest-Master.Python3

00:01:14

passed Pygolang.UnitTest-Master.Python3

00:01:15

failed Pygolang.UnitTest-Master.Python3

00:01:21

passed Pygolang.UnitTest-Master.Python3

00:01:13

passed Pygolang.UnitTest-Master.Python3

00:01:50

passed Pygolang.UnitTest-Master.Python3

00:01:37

passed Pygolang.UnitTest-Master.Python3

00:01:26

passed Pygolang.UnitTest-Master.Python3

00:02:17

passed Pygolang.UnitTest-Master.Python3

00:01:23

passed Pygolang.UnitTest-Master.Python3

00:01:11

passed Pygolang.UnitTest-Master.Python3

00:01:20

passed Pygolang.UnitTest-Master.Python3

00:01:22

passed Pygolang.UnitTest-Master.Python3

00:01:10

passed Pygolang.UnitTest-Master.Python3

00:01:07

passed Pygolang.UnitTest-Master.Python3

00:01:08

passed Pygolang.UnitTest-Master.Python3

00:01:08

passed Pygolang.UnitTest-Master.Python3

00:01:09

passed Pygolang.UnitTest-Master.Python3

00:01:07

passed Pygolang.UnitTest-Master.Python3

00:01:11

passed Pygolang.UnitTest-Master.Python3

00:01:07

passed Pygolang.UnitTest-Master.Python3

00:01:10

passed Pygolang.UnitTest-Master.Python3

00:01:08

passed Pygolang.UnitTest-Master.Python3

00:01:10

passed Pygolang.UnitTest-Master.Python3

00:01:06

passed Pygolang.UnitTest-Master.Python3

00:01:06

passed Pygolang.UnitTest-Master.Python3

00:01:09

passed Pygolang.UnitTest-Master.Python3

00:01:08

passed Pygolang.UnitTest-Master.Python3

00:01:06

passed Pygolang.UnitTest-Master.Python3

00:01:08

passed Pygolang.UnitTest-Master.Python3

00:01:07

passed Pygolang.UnitTest-Master.Python3

00:01:07

passed Pygolang.UnitTest-Master.Python3

00:01:08

passed Pygolang.UnitTest-Master.Python3

00:01:20

passed Pygolang.UnitTest-Master.Python3

00:01:26

passed Pygolang.UnitTest-Master.Python3

00:02:11

passed Pygolang.UnitTest-Master.Python3

00:01:48