cmd_i2c: introduced get_alen helper function