rundir: Fix memory leaks

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>