layers: Improve locking in the draw_state layer.

This includes generating return values within locks, and doing the actual
return outside of the lock.
1 file changed