On Exact Sampling in the Two-Variable Fragment of First-Order Logic