Pause game when tab/window inactive

Fixes #5