Report task profile locked for leaf tasks only

A root task (ActivityStack) was reported to the TaskStackListener
(sysui) that the task had been put in a locked state. So, the task
was requested by sysui to be used as the launching task while
starting activity and was failed.

Also fix an issue that activities could be removed if the task has
overlay activities.

Bug: 148214416
Test: atest ActivityRecordTests
Change-Id: If76ef668158a97d50c0d541319402c0bbdae2184
3 files changed