vf_dlopen ildetect: make the wrapper shell script more robust