Fix possible memory leaks in libirecovery.c and module.c