let get_train_error() get called without a SegFault

Hi, 

as already described in http://code.opencv.org/issues/2990#note-1 OpenCV fails when RTrees.get_train_error() is called. 

This partially fixes the issue but I still don't think it's the right way to solve it.