Domain walls and the melting of commensurate surface phases