i#1551 port to ARM: implement cleanup_and_terminate()

Implements cleanup_and_terminate() for ARM.
Augments the asm defines with a number of missing pieces.

Review-URL: https://codereview.appspot.com/186600043