Move variable declarations to the top of blocks

gsound.c now compiles with -std=c89 -Wall -pedantic, which is
hopefully paranoid enough...
Fix warning with Clang being ultra-paranoid

Because, why not?