Pass sortDirectoriesFirst to directoryContents nodes.

This is a fix for #9206.

cc @ingorichter