[PATCH 1/2] reg/tests: Check all error codes in delete_tree() before returning