Check if $module is an object

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