qsvenc: do not try to close the encoder if the session is NULL