Compactness characterization of commutators for Littlewood-Paley operators