Spanish emergency services have said that four migrants died and several hundred were rescued from four boats off the Canary Islands.