PROTON-552: Change code to be C89 compatible

The Visual Studio C compiler before VS2013 only supports variable
declarations at the start of a code block. So change any files that are
compiled as C under Visual Studio to conform to this.