Cost controls yield modest gains for Walgreens in second quarter