Fix bugs in stack utility procedures.

libarduserial/arduserialtools.c:
* Fixed the non-working stack procedures.
* This file was known as tools.c before.  We change that to prevent name
  conflicts.

testsuite/tools/teststack.c:
* wrote some basic tests for the stack utility procedures.