test ctf writer: fix lints
Coverity found the following defects:
** CID
1124096: Null pointer dereference (FORWARD_NULL)
/tests/lib/test_ctf_writer.c: 140
** CID
1124095: Dereference after null check (FORWARD_NULL)
/tests/lib/test_ctf_writer.c: 139
** CID
1124094: Dereference after null check (FORWARD_NULL)
/tests/lib/test_ctf_writer.c: 211
** CID
1124093: Argument cannot be negative (NEGATIVE_RETURNS)
/tests/lib/test_ctf_writer.c: 144
** CID
1124092: Argument cannot be negative (NEGATIVE_RETURNS)
/tests/lib/test_ctf_writer.c: 144
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>