Optimization of progress_app::handle() by using a shared pointer for the directory.