Workaround for gcc volatile struct member bug

gcc does not handle struct with volatile member assignments correctly.
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47409

Using structure assignments for the StateAndFlag union can cause gcc
to optimise the code incorrectly. Doing the assignment using the
as_int member forces the correct behaviour.

Change-Id: I6379d36add16c321b2e4d1dcd6fd8c959f3f92d6

Conflicts:
	runtime/thread-inl.h
	runtime/thread.cc
Use dmb.

We don't support ARM processors that don't have dmb anyway.

Change-Id: I41b15a1592febcc0b33d93c291431d00692a2928