do not break params filtering on nil values

backport of https://github.com/rails/rails/pull/12159