Fix exec flags handling when using verbose
Fix a memory and fd leak