Fix non-C89 variable declaration.

Microsofts C compiler does not support the C99 standard, so variables has
to be declared at the start of a scope.