Periodic flows, rank-two Poisson structures, and nonholonomic mechanics