Put directories first when sorting torrent content by name

Closes #1594.