rm: fix memory leak on init failure

AVInputFormat.read_close is not called if AVInputFormat.read_header
fails, so this needs to be handled separately.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
