Use atomic instructions on linux thumb v7.

This matches gcc's behaviour. The patch also explicitly parses the version so
that this keeps working when we add support for v8.