Make ValidatorServiceProvider work with both 2.1 and 2.2 of symfony/validator

Closes #584, #585.