Expand env vars for `custom_modules` build option
Expand env vars for `custom_modules` build option

The order of conversion is also changed to ensure that the resulting
path can be properly validated later on.

(cherry picked from commit 80249e7190cd28cd3dad49f660ea202b7fc9fdef)

ex/godot,ex/godot,ex/godot,ex/godot,ex/godot,ex/godot,ex/godot,ex/godot