CKE Restaurants swings to profit in 2Q