Compile OpenCV with GCC visibility set to hidden

duplicating #835