fixing build of 2.4 branch with VC12 (aka 2013)

master branch was fixed before, no need to merge this to master!
- disable openexr (numerous undefined std::min & std::max)
- workaround for two compilator bugs