The story
From cracker + -s. The South African sense is from their sound and its status as a plurale tantum by association with trousers. The adjectival sense derives from British naval expressions referring to firecrackers in one's head, originally as "he's got the crackers" and then "he's gone crackers" before the present "he is crackers".
Etymology from Wiktionary, CC BY-SA 4.0.