Merge changes I5676863f,Id4f30f48 into main

* changes:
  Use unique_fd in tcutils
  Use scopeguard from libbase_headers and delete the copy