mesa: move/fix levels check for glTexStorage()