American Airlines swings to a loss, but tops estimates for Q2 forecast