Fix occasional failures in some tests

Review at https://rbcommons.com/s/OpenH264/r/1001/.