Avoid double free of res->modules

I forgot to set the modules to NULL before cleanup. If there was an error
with the GetModuleFilenameEx or GetModuleInformation API Call, it would
make a double free.