Marc Balmer (of the OpenBSD Project) investigated reports of weird filesystem behaviour and found a 25-year old bug in the BSD libc implementation of readdir().
The fix should be in the trunk of all BSDs now and scheduled for merges or backports soon (e.g. see https://svnweb.freebsd.org/base?view=revision&revision=178772 ).