sync: Fix a race condition between release_obj and print_obj