The Spanish supreme court has withdrawn a European arrest warrant for the ousted president of Catalonia, Carles Puigdemont.