Mesa: fix crash on exit with amd + vdpau

thanks @fritsch credits to @koying for the patch