add close finalizers and allow multiple closes

IOStream allows multiple closes, so we should do too.