[System.Core] Don't auto increment when trimming hashset. Fixes #18687