better formatting for nested functions
unleak resources

Have to call C.jlog_close, or better yet, log.Close() to close
the opened jlog.
appease @jeddenlea

same thaaaang, this is just more *explicit* (pfft).