Cogl was already counting them internally with the pending_frame_infos queue. This allows us to remove the pending_swaps counter.
pending_frame_infos
pending_swaps
This doesn't resolve any bugs but it does allow us to remove the redundant counting logic which has proven unreliable in the past (1, 2).