Check if $module is an object in JModuleHelper::renderModule()

Fixing the PHP warning
> Creating default object from empty value in /.../libraries/cms/module/helper.php on line 164

if `JModuleHelper::renderModule()` is called without a proper module object.