Fix read of uninitialised variables in embed_sim_init

If get_module_ref fails (e.g. because it can't find the cocotb module) then cocotb_module and arg_dict may contain garbage values after the jump to cleanup which potentially calls Py_DECREF on them.
Fix crash in embed_sim_event if embed_sim_init fails

If embed_sim_init fails then the pEventFn global will be NULL. However, when an "end of simulation" event occurs embed_sim_event will still dereference this when it calls PyObject_Call. Added a NULL check around this function.
Merge pull request #138 from nickg/valgrind

Fix crashes due to uninitialised or NULL variables