GCC Cleanup

This patch cleans up various warnings uncovered by Wall, Wextra, Wshadow, Wlogical-op, Wcast-qual, Warray-bounds, and Wdisabled-optimization using gcc 4.7.2. Most of the warnings are harmless issues (const correctness, sign issues, dead code removal, etc.), but there are a couple of interesting finds that could have negative effects.

1. ec_socks.c line 76 was flagged by -Wlogicial-op for always evaluating true.
<pre>
if (ptr[1] != USER_PASS || ptr[1] != NO_AUTH) 	
          return NULL;
</pre>

2. Warray-bounds flagged a number of places where array bounds could be exceeded. Mostly these appeared to be off by one errors.

3. Wshadow marked variable shadowing in a few places. I'm not certain if there were any ill side effects or not.

4. Missing return statements on value returning functions. I believe that is undefined behavior so hard saying what occurs there.