Fix crash due to multithreaded access to Bitmap.
Merge pull request #1 from xo-energy/fix-multithreaded-crash

Fix crash due to multithreaded access to Bitmap.