Add native Windows thread support instead of using pthread