remove wine's broken _beginthread() and _endthread() and implement them properly