A Bayesian Nonparametric Perspective on Mahalanobis Distance for Out of Distribution Detection