[PATCH openEuler-1.0-LTS 101/103] share_pool: Free newly generated id only when necessary