Error code handling cleanup in rugger_repo_new_with_backend
Improve error handling and memory management in rugged_repo_new_with_backend