Safer initialization of audio settings

AudioSettings instance is initialized automatically in _getAudioSettings if it
is NULL. Also, multiple calls to initAudioSettings() will no longer leak
memory.
Extra null checking when creating files
Safer unix implementation of getCurrentDirectory

PWD is not guaranteed to be in the environment, which can occur for instance
when running in a debugger (or being execl'd from another process).
Marking functions as deprecated

Fixes issue #151
Implement two endian flipping test cases
Endian flipping must return unsigned types
Implement some more endian tests