Fix thread issue (API functions cannot be run from non-main thread) in sublime text 2