Cancellation of collisional frequency shifts in optical lattice clocks with Rabi spectroscopy