Near-critical tuning of cooperativity revealed by spontaneous switching in a protein signalling array