transpose: fix bug in shorten_filenames for file descriptors and cases where there is only one file