Add callback argument to track completion of dump

By the way, you can write this a little more succinctly:

```c++
Local<Value> maybe_function = args[1];
if (maybe_function->IsFunction()) {
  Local<Function> function = maybe_function.As<Function>();
  COMPAT(on_complete_callback = Persistent<Function>::New(function),
         on_complete_callback.Reset(isolate, function));
}
```