Do not attempt back to backs to leverage an ex EU fare. Can't have your cake and eat it, always allow one 'rotation' on to allow for delays in the airport.
Speaking as someone who regularly does this - though why MAD ? Check from AMS - better schedule, and a very quick flight. You can even check bags at LHR for JNB and then do your LHR - AMS - LHR hop
Ed