Use correct variable in require()

Use modname instead of the nonexistent name in the error message if
require() is passed the wrong type of parameter.

Change-Id: I2e96d283e34a16e4675141ce8ccddbcc045ef2a1
Merge "Use correct variable in require()"