hmm... maybe this will work:
place a trigger_once around every key and a math_counter.
let's name the trigger key1_trigger
when you pick up a key its trigger will add 1 to the key's counter.
the counter will hit max on 1 and will activate all doors' masters(which will unlock them).when you open a door it will first kill its own master resulting in permanent unlock.then it will subtract from all keys' counters 1,they will hit min(0) and will deactivate all masters,but since the opened door's master is gone it will not lock anymore.
Haven't tested it but try
And I don't think it's possible to have the math_counter to send its value to any entity,sorry