net/mlx5: Fix potential deadlock in command mode change