Capture error output of pthread_join.

pthread_join() does not store an error condition in
errno. Instead, it returns it as the non-zero value
in the return code.
Prevent UART threads from handling signals.

On FreeBSD, UART1's thread was consistently catching the
SIGINT and causing the shutdown process to occur. This caused
the pthread_join() to fail on that thread with a "deadlock avoided"
error. So, just prevent these threads from handling signals
and force the main thread to do so.
Don't shadow global declarations on older glibc

Older glibc's warning about shadowing some global declarations so this
cleans that up.
support running the AVR code with a gdb stub

Allows you to attach GDB to the AVR CPU to debug any AVR code being
emulated.
build: small cleanup to the build rule
build: clean up to use a variable for pkg-config

Rather than hardcoding the path that simavr installed to, use the
variable defined at the top.
cores: move function prototype from common header

There's no need to for the core generation function to have its
prototype in a common header for parts that don't need to know anything
about SimAVR.
pflash: take config as arg to flash_open_or_create()

Tweak flash_open_or_create() to take the configuration details so that
it may use more bits later, like a bit for erasing the flash entirely
prior to laoding.
pflash: support erasing contents prior to load

Prior to loading anything into any region of flash you may completely
clear it with the argument -e.
build: support building multiple binaries

Rather than assuming all sources will go into one binary, support
multiple binaries for the future.
cores: add header for core specific data

Add a header to define function prototypes or any specific data to the
cores so that the generic drumfish header stays generic.
logging: basic API for logging with time stamps

To facilitate logging levels and assist with debugging we need a logging
API. This should suffice to cover the basic needs for both of those use
cases by prefixing each message with the time since the CPU started and
allowing the user to filter on log level.
logging: wire up existing debug msgs to API

Wire up some of the existing debug messages to the logging API so they
can be more finely controlled at runtime.
uart: disable arbitary usleep(1) in simavr

SimAVR runs the UARTs with a usleep(1) by default but we definitely
don't want that behavior since it messes up the UART timing. The example
firmware expects to send a byte every 200ms but with the usleep(1) its
closer to 5s which is a huge time delay. Without the usleep(1) the
timing as fast as the system will go.