[Profiler] Fix flaky test_memory_timeline_no_id (#103441)
Summary: On CPU only runs, the allocator seems to sometimes report out of context CPU allocations, but sometimes not. Let's just check the expected list is in the actual list for CPU. GPU test stays the same.
Test Plan: CI, ran locally 100 times.
Reviewers: dberard
Resolves: https://github.com/pytorch/pytorch/issues/103286
Pull Request resolved: https://github.com/pytorch/pytorch/pull/103441
Approved by: https://github.com/davidberard98