Merge pull request #18003 from sikachu/permit_all_parameters-thread-safety

Make AC::Params.permit_all_parameters thread safe