America’s biggest pharmacy chains are closing hundreds of stores, laying off thousands of workers and rethinking their role in our lives.