Scrambling to cut costs, Germany’s Volkswagen warns it could shutter factories in the automaker’s home country amid rising competition.