Having failed to take Limerick, William leaves Ireland