Moved some common conditions for winning/losing.

A game can only become won/lost if it is not yet lost/won.
A game can only become won if it is not about to become lost.
Fixed win condition for more than one Gold.

Previously, the game would be won as soon as Pacman picks up one gold.

The new condition requires Pacman to pick up *all* remaining Gold in the
next turn. As Pacman can only move to one position in each turn, this
can only be satisfied when there is just one Gold remaining.