Explicitly close resource filehandles

May help with https://github.com/gittip/www.gittip.com/issues/2245