ogg: check and propagate memory allocation failures as appropriate

CC: libav-stable@libav.org