Backport "fix for DECIDE_TEXTURE_TARGET" from CM10.1

DECIDE_TEXTURE_TARGET hack wasn't correctly handling the
BufferRejecter that was added in JB. On rare occasions this
resulted in graphical corruption when wrong texture target
was called from BufferRejecter. Move DECIDE_TEXTURE_TARGET
switch before the rejecter to take care of this.

Originally author: KonstaT
Backport from CM10.1 by: Daveee10
Thanks for point it: xelyt