[erl] upgrade code to support Erlang 17 runtime