Probing the structure of jet-driven core-collapse supernova and long gamma-ray burst progenitors with high-energy neutrinos