[FIX] #4309 Attachments with res_id=0 should not be considered orphaned

Same as #4310 for v8