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. 


------ edit
I'm sorry, actually this fix is based on version 2.4.5. but I overlooked the box where I coud set that.