sdm: Fix potential out of bound access during dumpsys

Update the layer_stack_invalid after successful prepare to avoid out
of bound access during surfaceflinger dumpsys

Change-Id: I22480ab3c6998a6b5e88488f169cbeac75650509
CRs-Fixed: 2238352
1 file changed