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>
