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.
Adding checks for properties and logging the error.
Merge pull request #3056 from Bakual/FixRenderModule

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