US snack maker J&J Snack Foods reported higher earnings for the first six months of the year ahead of "modest" sales growth in the period.