vd_lavc: fix a small memory leak on init error

The private context wasn't free'd when codec init failed. Restructure
the code so that it can't happen.