Utils: Fix bug in commonPath() with directories

The algorithm expected a list of filenames, but the cmake plugin passed
in a list containing a directory and a filename. Appending a slash to
each entry. (Except root entries.) fixes this.

Task-number: QTCREATORBUG-13606
Change-Id: I518a2601295017636f4c450cc8a9026f4b41689a
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>