DaqDeviceIndex: Implement new detection heuristic for OSX + single device.

Always choose daq as index of device with maximum index in the single
device case.
Finds proper daq, but DaqAInScan still doesn't work on OSX 10.7. But
maybe it helps somebody with OSX 10.8+
PsychHID/Linux: Fix memory leak in libusb on init failure.

As found by Yaroslav.
Fix printf bug in Screen and PsychKinectCore

printf() Error reporting string had a %i defined, but no actual
variable whose value to print.
-> These are on non-critical error paths, so no rebuild for mex files.
Can wait until a future release.
Found by Yaroslav.
Fix memory leak on error in FTGL drawtext plugin.

In the unlikely case of an error, we leaked a few bytes of unicode text.
-> Not critical: Recompile can wait for a future release.
Found by Yaroslav.
PsychCV/OpenEyesTracker: Fix memory leak on error condition in svd.

Ok, this is code we don't even build atm, but doesn't hurt to keep it
free from memleak on error.
-> No recompile needed.
Reenable PsychCV for 64-Bit Octave on Linux.

This provides access to the ARToolkit tracking functions on
64-Bit GNU/Octave on Linux. As ARToolkit is GPLv2 licensed,
it - and therefore our PsychCV.mex file linked against it -
can only be used under GNU/Octave which is GPL licensed as
well. We only enable this on 64-Bit Octave for Linux, as a
little bonus for Linux users, if at all.

This just for testing. May get disabled before next beta release
again.

-> PsychCV for 64-Bit Octave on Linux built and tested.
-> ARToolkitDemo made functional again with GStreamer video capture
   engine as default.
OpenEyes: Tiny fixes -- However, this stays disabled for now.
Screen: Fix small bug in PsychNormalizeTextureOrientation().

Didn't restore the framebuffer binding to zero, as it should,
because PsychSetDrawingTarget(NULL); as used there would be
a no-op mostly for the purpose of resetting the binding to zero.

Fixed. Fixes a "invalid operation" error on nouveau. However, this
was not the culprit of morphing errors in MorphDemo. These remain
a mystery.
PrintPhotoReceptors, FillInPhotoreceptors: Bug fixes and restore Octave compatibility.

fields() doesn't exist in Octave 3.6.x, but fieldnames() does and does
the same thing.
Use proper short-circuit boolean operators.
Replace obsolete isstr() by ischar().
Fix loop variable bugs.
Linux XLib locking: The horror continues. Fix PsychHID XInitThreads()

Remaining use of XInitThreads in PsychHID can trigger crashes in
Screen() shutdown, due to mixup of non-threading and threading
x-connections in Screen vs. PsychHID. Only happened on Yaroslavs setup.

-> Make use of XInitThreads() in both Screen and PsychHID conditional
on a defined environment variable PSYCH_XINITTHREADS. By default it is
not used, as we have our own locking for Screen() and don't need it in
PsychHID due to it using dedicated x-connections for its threads (main
thread vs. kbqueue thread).
-> The environment variable is for debugging only, or in the faint hope
that it might fix crashes with the FOSS mesa intel/nouveau..
gfx-drivers caused by DRI2's racy way of sending drawable invalidate
events to clients. We'll see if it helps in those cases or not. Our own
locking definitely doesn't work reliably there on the Intel driver.
Rebuild Screen and PsychHID for Linux with latest XLib threading fixes.

All 32/64-Bit Octave/Matlab for Intel cpus.
No rebuild for 32-Bit ARM, the 3 people that use it will have to suffer
a bit longer.
Merge pull request #174 from kleinerm/master

PTB BETA RELEASE "Hammertime!" SP4 - "Deadlock"

* XLib threading fixes for regressions introduced into Linux PTB.
* Make DaqDeviceIndex a bit more robust on OSX.
* Make IsomerizationInEye/DishDemo work again on Octave and fix some bugs.
* Reenable parts of PsychCV for 64-Bit Octave on Linux. (Experimental)
Merge pull request #175 from Psychtoolbox-3/master

PTB BETA RELEASE "Hammertime!" SP4 - "Deadlock"

* XLib threading fixes for regressions introduced into Linux PTB.
* Make DaqDeviceIndex a bit more robust on OSX.
* Make IsomerizationInEye/DishDemo work again on Octave and fix some bugs.
* Reenable parts of PsychCV for 64-Bit Octave on Linux. (Experimental)