net/mlx5_core: Add helper function to read IB error counters