[bug] Fix possible memory leaks

Fix wrong usage of realloc().
Found by VC's /analyze option.
Remove obsolete variables from win32/Makefile*

Patch files for Ruby 1.6.8/1.8.1 are obsolete.
Import the latest st.[ch] from Ruby r47675
Merge branch 'ruby-2.x' into ruby-2.x-buildenv
Add a constant which is used in st.c
Merge branch 'master' into ruby-2.x
Merge branch 'ruby-2.x' into ruby-2.x-buildenv