The role of working memory in the probabilistic inference of future sensory events