Made maxiterations work also for BatchTrainer and ParallelBatchTrainer

Without the change Trainer.train() will only use maxIterations for online training methods and ignore it for batch training methods.