snow: Fix off by 1 error in reference picture management

Fixes out of array accesses
No release is affected by this bug

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>