BMW has had to go to court in a dispute over temporary workers at its plant in Leipzig, eastern Germany.