Add missing cmakedefine for HAVE_ASPRINTF and minor cleanup.

Fixes windows build.