Try to detect whether we load the deal.II libs in different modes from ASPECT and from plugins.

As discussed at the end of the previous pull request.