code_size_compare: make sure _remove_worktree executed

Add try and finally to make sure we remove worktree as expected even
if we hit errors by accident.

Signed-off-by: Yanray Wang <yanray.wang@arm.com>
diff --git a/scripts/code_size_compare.py b/scripts/code_size_compare.py
index 89d8fe9..cc43dc7 100755
--- a/scripts/code_size_compare.py
+++ b/scripts/code_size_compare.py
@@ -423,9 +423,11 @@
         """
 
         git_worktree_path = self._create_git_worktree()
-        self._build_libraries(git_worktree_path)
-        res = self._gen_raw_code_size(git_worktree_path)
-        self._remove_worktree(git_worktree_path)
+        try:
+            self._build_libraries(git_worktree_path)
+            res = self._gen_raw_code_size(git_worktree_path)
+        finally:
+            self._remove_worktree(git_worktree_path)
 
         return res