Fix FileInfo.path().

Remove the trailing slash for directories if the file name is empty.
This makes sense, since repeated invocations of path() will strip off
additional components, as one would expect. It is also how
QFileInfo::path() behaves.

Change-Id: Idc28fcaba5d3a8c907b8d6ce8f55001909f00fa8
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>