Gene loss during a transition to multicellularity