Maddinson survives after Proteas blunder