Support conditional register cache flushing on ARMv7.

Similar to PR #451, but for ARM as well.