Check if $module is an object

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