[OptionsResolver] fix count() and exceptions

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Please see commits.
As said in the commit message, it's done to make phpunit pass in `--strict` mode (which is also how the error in testFailIfGetDefinedButUnset can be detected).