Update mkvno after randkey

Here is a fix for #7994 and a test case.