Fix logname crash

I sent it direct to the branch since the code on master changed a lot and seems to do not have pbi_preload.so anymore.