Fix missing strtoll on Cygwin and MinGW

This is refined version of pull #246.
Closes #246
Remove unused HAVE_XXX defines