Port glXCopyContext bug from 4.0 branch.