Canonify promiser name before testing if class is set

Also clean up some code; the function now asserts that
excluded is valid, and there is only one caller.

Add uncanonifed promiser to existing test case.

Fixes Redmine #6561
The other test from the other pull request is unrelated and doesn't trigger this bug. This is about fixing the regression reported in https://dev.cfengine.com/issues/6561