According to the AnyEvent::Impl::Tk
documentation, a hidden Tk MainWindow is created to get things working. But it seems that this hidden window is never destroyed automatically. As a workaround, you can do it yourself:
$AnyEvent::Impl::Tk::mw->destroy;