doc: test-writing-guidelines

Add thread-safety paragraph
Add example of how to use TST_DECLARE_ONCE_FN

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>