don't crash if builddir is suffix of sourcedir (or vice-versa)
don't crash if builddir is suffix of sourcedir (or vice-versa)

Change-Id: I97a6e2ebd51350cbf39c86efa5c26a376c49da95
Reviewed-by: Joerg Bornemann <47777b9406dbddd02a3fdca8341789a013805a11@digia.com>
(cherry picked from qtbase/b30273ec4a4ce65794fd402c6e3eb21de7bae1b9)

mer-qt/qttools,mer-qt/qttools,mer-qt/qttools,mer-qt/qttools,mer-qt/qttools,mer-qt/qttools