Fix in handling header decode errors

If header decode was unsuccessful, do not try decoding a frame

Also, initialize pic_wd, pic_ht for reinitialization when
decoder is created with smaller dimensions

Bug: 28886651
Bug: 35219737
Change-Id: I8c06d9052910e47fce2e6fe25ad318d4c83d2c50
(cherry picked from commit 2b9fa9ace2dbedfbac026fc9b6ab6cdac7f68c27)
(cherry picked from commit c2395cd7cc0c286a66de674032dd2ed26500aef4)
