Match ObjectiveC API and allow CloseWithCode reason to be nil