Make AC::Params.permit_all_parameters thread safe

As discussed in #16299[1], this attribute is not thread safe and could
potentially create a security issue.

[1]: https://github.com/rails/rails/pull/16299#discussion_r15424533
Merge pull request #18003 from sikachu/permit_all_parameters-thread-safety

Make AC::Params.permit_all_parameters thread safe