Optimal firm behavior under pollution irreversibility risk, and distance to irreversibility thresholds