Fix segfault in AVS_RBTREE_SIMPLE_CLONE
Fix segfault in AVS_RBTREE_SIMPLE_CLONE

Summary:
T1289

- Reproduce segfault in OOM condition during rb_subtree_clone

- Fix segfault in AVS_RBTREE_SIMPLE_CLONE

When the application runs out of memory during AVS_RBTREE_SIMPLE_CLONE,
this may lead to calling free() on an invalid address.

Test Plan: make avs_rbtree_check

Reviewers: kfyatek!, mkrawiec!

Differential Revision: https://phabricator.avsystem.com/D4880

AVSystem/avs_commons,AVSystem/avs_commons,AVSystem/avs_commons,AVSystem/avs_commons