Variable definitions must come first in C89.

Fix compile error in Visual Studio. if statement preceded local variable
declarations which is not valid C89.