ProfilePathFinding: gracefully handle windows closing

Signed-off-by: Jean-Yves Tinevez <jean-yves.tinevez@pasteur.fr>