Fix logging code that breaks MTP sync (bug 1152)