What prevents modifying the GPU miner from contributing shares to a pool but if it solves the block it just keeps it?
The headers the GPU is actually hashing include a payout address public key, the private key of which is only known by the pool's server. If the GPU is hashing headers that give the generation payout to a public key the individual miner has a private key for, then the found solutions won't verify when resubmitted to the pool, and the miner will get no credit with the pool.