[cppmyth] Cleanup code for thread safety in ProtoEvent