Curl code was missing User Agent header

* added use agent HTTP header, now required by GH
* closing curl after use.