This fully implements my suggestion from id:"20120411193609.GC13549 at mit.edu". Originally this was just meant to make the code more portable (since d_type is not portable), but it wound up also simplifying some of the notmuch new logic.