Added a global int to be set when a crash occurs

This way you can break a loading threads while loop, because finished_loading will never be 1 :)