properly check for error from pri_timer2idx (bug #4117)