Further stabilize fix for #8.

 - Add volatile keyword as suggested by Sangjin Han.
 - Testing with this patch has worked flawlessly for at least 3 hours.