BUGFIX: fix texture leak on logout/in (kahrls patch from 2011)