mbuf: cleanup function to get last segment