Fixed numerous issues and added locking

Added thread locking, fixed getPosition, setPosition, unloadSound and proper OpenAL error fetching.