Walgreens reported a better than expected profit on flat sales for its second quarter Tuesday morning and unveiled an expanded partnership with AmerisourceBergen that could give the pharmacy operator an equity position and seat on the drug wholesaler’s board.