Detaches the portal if attached to a host.
Returns a future that completes when detached.
@override Future<void> detach() { _locals = const {}; return super.detach(); }