What's happening if one of concurent lock on a table rename the locked table?
The objects id (oid) at the time the statement is prepared and executed. Pg_locks doesn't even store the relations name.

        View "pg_catalog.pg_locks"
       Column       |   Type   | Modifiers 
--------------------+----------+-----------
 locktype           | text     | 
 database           | oid      | 
 relation           | oid      | 
 page               | integer  | 
 tuple              | smallint | 
 virtualxid         | text     | 
 transactionid      | xid      | 
 classid            | oid      | 
 objid              | oid      | 
 objsubid           | smallint | 
 virtualtransaction | text     | 
 pid                | integer  | 
 mode               | text     | 
 granted            | boolean  | 
 fastpath           | boolean  |