Profinite detection of 3-manifold decompositions