Properly trim end spaces in plist for files and directories