Code cleanup in texture generation (unnecessary OpenGL calls removed)

Code cleanup in texture generation (unnecessary OpenGL calls removed)
Asynchronous code (for disc operations) refactored and corrected

Asynchronous code (for disc operations) refactored and corrected:
- Threads replaced by Tasks and async/await keywords. Due to this many
unnecessary flags/code parts could have been removed.
- MainThreadDispatcher introduced - to execute OpenGL calls in the right
context during asynchronous operations (allows dispatching stuff to the
UI thread).
- Locking of fileNodes array during asynchronous operations corrected -
now always the correct file nodes number is being created.