Robustness to Spurious Correlations Improves Semantic Out-of-Distribution Detection