Evasion of tipping in complex systems through spatial pattern formation