Cross-linking a thermoplastic linear foam during molding