Layoffs sweep TV networks and their affiliates