A unique decomposition theorem for 3-manifolds with connected boundary