An invariance principle for differential inclusions with application in adaptive control