pet_stmt_from_pet_expr: fix memory leak on error path