Bugfix 1873 : returning image keypoint descriptors in bagofwords.cpp

Fixed the bug mentioned in bug report 1873 + fix on line 152 : pure declaration
Issue : http://code.opencv.org/issues/1873