fixed locking in getevent
fixed last_event_time handling
added thread id to dbg message