Fix a possible dead lock when opening a file when one is already playing.

Easily reproducible with madVR.

Ticket #3865.