`DMPlexGetTransitiveClosure()` writes to the work array if the output pointer (`closure`) is initially NULL and overwrites the output on each consecutive call.