Fix: BAD_POOL_CALLER error in Windows 10/8/7