Fix error handling in finding erlang-mode