common/mlx5/linux: replace malloc and free in glue