Posterior sampling-based online learning for the stochastic shortest path model