Implement CTF Writer Class locking

Event, Field 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>