Use atomic pointer swapping for swapping frames

I can't help but wonder if this is causing some issues with frame
duplication, I suddenly realized the code wasn't particularly thread
safe so I threw this in as a precaution.
Fix issues with BF4 and BF:HL borderless mode
Merge remote-tracking branch 'upstream/master'