Fix potential out of bounds access caused by CM_GridPlane

Coverity doesn't care if there is a warning, out of bounds access is bad.
Don't use memset with non-zero value to fill ints

Coverity reported using value -2 as a bad memset. Really doesn't make sense when filling ints and not bytes too.
Fix potential buffer overflow in PS_ReadPrimitive

Found by Coverity.
Fix unchecked buffer size issues in l_script.c and l_precomp.c

Found by Coverity.
Fix max bans range check in SV_AddBanToList

Adding too many bans would write out of bounds. Found by Coverity.
Have OpenGL2 "map $lightmap" check for NULL tr.lightmaps too

Zero length lightmap lump will have NULL tr.lightmaps.

OpenGL1 already has this check, because r_vertexLight 1
would crash Team Arena. OpenGL2 does not disable loading lightmaps
when r_vertexLight is 1 though, so it does not have that issue.
Fix potential buffer overflow caused by long tcMod args

Found by Coverity.
Fix OOB access in CM_EdgePlaneNum without erroring in CM_GridPlane

I changed warning to error in 9d74227559d46b85d0c43d395cd280d3de7ae8f4,
which broke JA's mp/ctf4 map and probably others.
Fix potential OOB in Windows Dedicated TTY CON_Show

Found by Coverity.
OpenGL2: Reimplement MD3 tangent space calculation.
OpenGL2: Really obvious optimization to previous commit.
Fix an invalid null deref check in the slider code.
OpenGL2 don't try to dlight surfaces that had all dlights culled

In the renderers, dlightbits are never cleared from world surfaces.
The dlight image does not repeat, so if it draws on extra surfaces it's
not visible.

However if using a repeating image (tr.defaultImage instead of tr.dlightImage);

  * In OpenGL1 image is only drawn on surfaces close to dlight origin.
  * In OpenGL2 image is draw on surfaces clearly outside the dlight radius, including past non-dlighted surfaces.

It seems there was a similar issue with pshadowBits. So update surface
dlightBits even if 0, like already done for pshadowBits. This causes
only surfaces close to origin to be affected. (Though it is a little
farther than in OpenGL1.)

I have no idea why this isn't a problem in OpenGL1.
Fix SkipRestOfLine going past end of string

If string data starts with a 0 (string terminator), don't skip over it at p++.

Not causing any problems in ioq3 as far as I know.
Remove unused array joy_pressed
Remove unused cvar in_joystickDebug
Fix overstrike/insert logic being reversed in q3_ui
Don't draw client console buffer past top of screen

Thanks @Pan7.
Restore drawing a cut off client console line in 1920x1080

The text lines don't meet at top of the sceen in 1920x1080, restore
drawing a cut off line across the top. In 640x480 this line isn't seen
at all. This is still better then trying to draw twice as many lines
than are actually seen (the way it was before the last commit).
Merge branch 'master' of https://github.com/ioquake/ioq3