Boeing posts loss as it grapples with delays on commercial, defense programs