layers: Reorder to prevent Null deref; add test

Found by running Hologram with validation and push constants
using args "-p -v".
Hologram is issuing a memory barrier in the push constants
mode.  This will be fixed in Hologram, but validation should
not be crashing.

Change-Id: I1e76c3fca0152fc3bf8c1de3db3b044f650c202f
2 files changed