allow compilation with msvc

MSVC demands predeclaration of all variables. The changes in this commit
move declarations to earlier parts of the code, thus fixing a number of
errors thrown by the MSVC compiler.
Merge branch 'msvc-fix' of github.com:wchristian/DBD-mysql into wchristian-msvc-fix

Conflicts:
	dbdimp.c
Merge branch 'master' of github.com:CaptTofu/DBD-mysql
Found call to trace needed to be removed for public release