Don't compare non-identifiers with `free-id=?`.

Closes PR 14877.