German carmaking giant Volkswagen has seen its profits fall and plans to close three plants in Germany.