fix double closing </a> for filenames

The current filelist rendering in stable6 is broken. It renders the closing `</a>` tag twice for files. Furthermore ,the second `if($file['type'] == 'dir')` check can be merged into the first.

@DeepDiver1975 @MorrisJobke @VicDeo dunno if it breaks anything, but interestingly IE11 was picky enough to tell me about it. Not needed for master.