fix Issue 11392 - dirEntries segfaults

This add the test for https://github.com/D-Programming-Language/dmd/pull/2704