rtspenc: Check the return value from ffio_open_dyn_packet_buf

Also clear the AVIOContext handle after freeing, to avoid
possible dangling pointers if the later call fails.

Signed-off-by: Martin Storsjö <martin@martin.st>
rtpenc_chain: Check for errors from ffio_fdopen and ffio_open_dyn_packet_buf

Signed-off-by: Martin Storsjö <martin@martin.st>