Boeing on Wednesday posted a smaller-than-expected loss in a quarter marred by a number of safety-related incidents that