IAR/CXX: Fix compatibility with CMP0057 OLD

Commit a9073db7 (IAR: update language specification detection, 2021-09-23)
added usage of the if() IN_LIST operation and forgot to account for it not
being available in CMP0057 OLD mode.
Push and temporarily enable the policy. Also avoid the unnecessary temporary
variable for the list.

Fixes #23147.
41 jobs for !6921 with iar_cmp0057 in 4 minutes and 18 seconds (queued for 3 seconds)
latest merge request