MediaGroup: Rework media count update triggers

To avoid a situation in which after updating a media type, the
decrement trigger would run, then the empty group deletion trigger
would kick in, causing the increment trigger to fail.

Fix #247
3 jobs for master in 7 minutes and 19 seconds (queued for 3 seconds)
Status Job ID Name Coverage
  Test
passed #391657
amd64 docker
linux

00:07:19

passed #391658
amd64 docker
win32

00:03:39

failed #391659
amd64 docker
win64

00:03:32

 
Name Stage Failure
failed
win64 Test

1 FAILED TEST
[swscaler @ 00000000356471c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 00000000356471c0] Warning: data is not aligned! This can lead to a speed loss
[swscaler @ 00000000358c7900] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000035a11100] deprecated pixel format used, make sure you did set range correctly
Running after_script
Uploading artifacts for failed job
ERROR: Job failed: exit code 1