Unit API: Shared data initialization and cleanup

Unit descriptors now have two new entry points; OpenState() and
CloseState(). These will be called during initialization and destruction
of any A2 state using the unit, and can optionally create per-A2-state
shared state data that will be passed to the Initialize() entry point for
all units in the respective state.

The OpenState() and CloseState() calls are guaranteed to be serialized,
making them easy to also use for process wide shared state management,
without the need for additional synchronization.

All units have been updated to the new unit API.

Closes #171.
A2_WAVEPERIOD is now in waves.h

The former SC_WPER has been renamed A2_WAVEPERIOD, and is now part of the
official API. The idea is that hardcoded oscillators and the like should
be able to rely on this, allowing them to use the built-in waves directly,
instead of rendering their own copies.