Apparel giant Hanesbrands returned to profit in its fourth quarter, helped by its strongest revenue gains of the year.