Report error for return statement in module.

Fixes #1173