you could always modify the latch tension so it snaps SHUT when the key isn't holding it open, or physically fill the latch with a screwdriver , D shackle / etc.
then even if you try to shut the tailgate.. it wont actually catch until you use the key to OPEN the lock.
BUT the basic key is the most simple / cost effective.
Charlie