Closes#1711 - race condition on stbi_failure_reason()
This does not only avoid the race condition on the failure string itself, but also makes failure state thread-local, meaning that each string will be correctly associated with the last image it failed to load.