This ensures the default gem filter does not affect backtrace lines that have a subpath incidentally matching a gem path. Fixes #40196.