Why Theresa May’s customs union defeat could ultimately save her premiership