Recognizing gimbal lock wouldn't be very difficult. Using a rotary encoder on each axis, you could measure their angles and tell if any pair of gimbals was aligned. And apparently there are techniques for arbitrarily rotating one gimbal when lock is detected.
It doesn't really add that much complexity to the gimbals. Rotary encoders are extremely inexpensive, and the information would just be interpreted by the central controller.