Declare do_str() function before the implementation

This ensures that GCC does not discard the do_str implementation in
some cases eg when compiling tests with debug enabled:
  make RUN_TESTS=1 DEBUG=1
Merge pull request #844 from chrisdearman/do_str

Declare do_str() function before the implementation
Add cache flush in py/asmarm.c and add new MP_PLAT_ALLOC_EXEC and MP_PLAT_FREE_EXEC macros

Fixes issue #840