She ran off with Max Ernst, drank with the surrealists – and kept her tea under lock and key. Charlotte Higgins on the dazzling life and art of Leonora Carrington