Fix order of resolving dependent role variables from vars files

Also adds a new class to the test_var_precedence test to check for
this type of error in the future.

Fixes #9178