Add better OpenMP detection and make an option to enable it

Bug report and inspiration: http://code.opencv.org/issues/3328.