inference: update `VALID_EXPR_HEADS` (#54789)
The `:enter` expression was replaced with `EnterNode` before, so we
don't need to handle it anymore. Also it's better to add `:public` to
`VALID_EXPR_HEADS` although we don't usually optimize a top-level thunk
containing `:public` expressions.