lavc: check for overflow in init_get_bits

Fix an undefined behaviour and make the function return a proper
error in case of overflow.

CC: libav-stable@libav.org
lavc: introduce the convenience function init_get_bits8

Accept the buffer size in bytes and check for overflow before passing
the value in bits to init_get_bits.