Looking at this video of a 737's flap extension, it looks like there is just one screw per side driving all of the flaps. Are there any systems in place that will allow the flaps to extend in the event of the linkage failing? What if hydraulics are lost? Also see point 3 on this question for more information about the flap type I am asking about (but generalized answers are welcome).
Given the footage in that video (rotating shafts rotating a jackscrew) There are 2 main failure modes I can think of: the linkage to the jackscrew fails or the jackscrew itself fails.
If the linkage fails the flaps will just not work. Jackscrews will hold the position of the flaps making the flaps fail up (not extended). There should be a feedback mechanism to stop the operational set of flaps before the asymmetric flaps affect the flight.
The jackscrew itself is engineered to not fail if properly maintained. There are also multiple jackscrews per wing
When flaps fail up the plane can still land. It just needs a much longer runway to account for the higher landing speed and a brake inspection. For example in this incident a Boeing 737-800 landed (almost) normally.
When flaps won't retract after takeoff the crew will circle back to the airport and land again with the flaps in takeoff position. This is somewhere between flaps full up and flaps in normal landing configuration.
As eluded to in @rachetfreaks answer the backup is the fact that the aircraft is flyable and more importantly can be landed without deploying flaps so a flap malfunction may not be as critical as other emergencies. Even aircraft up to the A380 or 747 in size can be landed without deploying flaps.
When I was doing my training in a PA-28 my instructor and I practiced no flap landings numerous times so that I could get the feel of landing in the event of a flap malfunction. Like any other type of emergency, pilots do practice this.
There is some relevant discussion here as well.