Merge gpu module changes from 2.4 branch

This changes weren't merged from 2.4.
Also this patch fixes gpu module compilation under Windows (video_writer.cpp).