Handle emission of both finish and close

This makes event emission consistent across Node versions,
and adds support for Node v0.8.