Update main.cpp

Workaround to solve the additional CPU usage problem when the miner is running in the background.