JetBlue Airways on Thursday joined most of the nation’s largest airlines in posting a profit, as more passengers returned to the sky in the second quarter.