Large-deviation theory for a Brownian particle on a ring: a WKB approach