mesa: Fix error returned by glCopyTexImage2D() upon an invalid internal format