fix using optional packages with the eWoms detection m4 macro

basically, we need to reverse order: first, try it the old (< dune
2.3) way, then the new way.