avcodec/h264_ps: Validate num_units_in_tick/time_scale before setting them in the context

This probably makes no big difference but it is more correct

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
