viewer: Fix traceback when closing the project

It's difficult to reproduce since it happens when the project recovery
fails and we gave up. Seems a good condition to add, since
__get_pipeline_position gets to the pipeline through the app.

Fixes #2129
1 job for viewer in 32 minutes and 50 seconds (queued for 1 second)