Incorporate patches from Handbrake 0.9.9

Handbrake patches libmkv with these, so they are probably important.