Add back in erroneously removed memory tests

I removed failing tests during the last two commits because I thought
those cases were failing because the mentioned fault when writing the
final result to memory was no longer valid.  This wasn't the case and
removing these test cases reduced the amount of code coverage in
core/memory.c.  I have added back these tests and correct the ordinal
of the allocation attempt to fail so that the tests now exercise the
correct code again.
Refactor semihost and GDB file I/O APIs

I refactored the semihost code path to make it easier to hook such
semihost support into pinkySim where the debugger isn't running as a
monitor on the target device itself.  These changes include:
* No longer updating errno from the MRI core database but instead
  extending an API at the platform level to take both the return value
  and errno in one call so that the platform specific code can figure
  out how to communicate the result values back to the target program.
* The GDB File I/O layer now uses structures for communicating all
  parameters which include a filename so that the length of this
  filename string can be included as well.  The length of these
  filenames, includes the '\0' terminator so that the string length
  can be calculated on the target and then communicated to the debug
  stub.