fix error reporting for dlsym with global symbols