Look for older Dojo version files in build system.

Enables building Dojo 1.6 and earlier. Fixes #17283.

Thanks @mahays0 for the initial patch.