Boeing swung to a fourth-quarter profit on Tuesday, driven by the sale of its digital aviation services provider, as well as rising jet output and stronger deliveries.