Fix saving target fragment when Fragment not yet created.

Bug 35928527

During optimized transactions, a fragment may be removed without
being created. That leaves the state of the fragment in INITIALIZING
and previously, that state wasn't ever saved.

This CL adds a test and changes the optimization test to
work with I649f1931745be43087ec3578e9195624e80821dc

Test: ran fragment cts tests
Change-Id: Ie7207cc647312d38b377405bc5ec8721db757d2e
2 files changed