Remove empty branches in a directory tree.