Don't invalidate layout on detach

This CL fixes a bug in RV where it was always expecting an onLayout
call after it is detached which may not be the case if the RV's
parent is detached-attached.

With this change, RecyclerView will only clear firstLayout flag if
a layout is already requested.

I've also changed SGLM to request layout on onDetach since it
releases View references.

Bug: 27229764
Change-Id: I8d7b2c9bc2b3e24eaa66253153ffa0c960f81bc6
7 files changed