elixir: fixed detection of homebrew installed erlang

Closes #22094.
Closes #22040.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>