Krispy Kreme narrows loss, but warns of challenges ahead