Fix boolean support for unless/onlyif

ea0c5cc attempted to implement the feature request in #6780, but did not
quite work. This commit properly implements the feature.
Merge pull request #7122 from terminalmage/issue6780

Fix boolean support for unless/onlyif