Make sure model exists before trying to wrap hooks

In certain cases, before running an update unregistered models will try to
register hooks. Trying to wrap create and write on these will cause
AttributeError on model_obj which would be None

Signed-off-by: Sandy Carter <sandy.carter@savoirfairelinux.com>

While trying to ugrade a series of modules on 7.0 Odoo, I've run into a serious blocking issue.

Before even starting the upgrade process, Odoo runs into an attribute error [1].

What is happening is that Odoo is trying to add hooks to a model which doesn't exist yet (before the module upgrading, which I am trying to do). Since the model is not in the pool, `self.pool.get(model)` returns `None` and the following accesses to it result in an `AttributeError`.

The solution is simply to check if `model_obj` is not None before trying to access it. There should always be a `None` check before trying to access attributes of an object reference that could be None. 

[1]
```
2014-10-23 21:52:19,130 6802 INFO oif openerp.modules.loading: loading 1 modules...
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "connector/connector/queue/worker.py", line 313, in run
    self.check_alive(db_name, worker)
  File "connector/connector/queue/worker.py", line 326, in check_alive
    self._notify_alive(session, worker)
  File "connector/connector/queue/worker.py", line 334, in _notify_alive
    dbworker_obj = session.pool.get('queue.worker')
  File "connector/connector/session.py", line 130, in pool
    self._pool = openerp.pooler.get_pool(self.cr.dbname)
  File "odoo/openerp/pooler.py", line 49, in get_pool
    return get_db_and_pool(db_name, force_demo, status, update_module)[1]
  File "odoo/openerp/pooler.py", line 33, in get_db_and_pool
    registry = RegistryManager.get(db_name, force_demo, status, update_module)
  File "odoo/openerp/modules/registry.py", line 203, in get
    update_module)
  File "odoo/openerp/modules/registry.py", line 233, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "odoo/openerp/modules/loading.py", line 436, in load_modules
    model._register_hook(cr)
  File "odoo/addons/base_action_rule/base_action_rule.py", line 203, in _register_hook
    model_obj.create = self._wrap_create(model_obj.create, model)
AttributeError: 'NoneType' object has no attribute 'create'
```