Cortical oscillations support sampling-based computations in spiking neural networks