gant: fix two bugs

reported by coverity:
- uninitialized r
- leaking fd
Merge branch 'master' of https://code.google.com/p/antpm
VS2012 build warning fix