Kroger swings to loss on union costs