don't use named semaphore for syncing image loading thread

Named semaphores are unique across process bounds, therefore a semaphore
left in an invalid state may cause locks on other processes.
The code has been exchanged by using pthread mutex and condition variables

See http://www.cocos2d-x.org/boards/6/topics/27188

Code has been tested on Android, iOS and Linux. Have not tested on Windows.
For testing I would recommend adding a log output at the following lines:
Line 123: This method call should block until the next signal will wake the thread, on windows we need to check that the call really blocks and the code does not enter a busy loop.

Optional:
Line 203: waking up the loading thread, so it can be closed
Line 290: waking up the thread for loading a new image