Driver: support detecting driver mode when clang has a version suffix without dash (PR21094)

Clang would previously not get into C++ mode when invoked as 'clang++3.6'
(though clang++-3.6 would work).

I found the previous loop logic in this function confusing; hopefully this
makes it a little clearer.

Differential Revision: http://reviews.llvm.org/D5833

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220052 91177308-0d34-0410-b5e6-96231b3b80d8