Implement CTF Writer Class locking

Event, Field, Clock and Stream classes can't be modified once they have
been instanciated once. Locking is handled recursively for compound
types and higher-level classes (Stream and Event).

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>