Proper handling of watch with onlyif/unless

This fixes #16647
Merge pull request #16648 from makinacorpus/f2

Proper handling of watch with onlyif/unless