fix deadlock when using multi-table queue_wait on mysql 5.1

The fix mitigates the following race condition, by not trying to obtain
t1.lockref in the flow chart if the table is already open.

query 1) select queue_wait('t1','t2',nn)
query 2) select ... from t1

Q1: locks and unlocks LOCK_open (in queue_share_t::get_share("t1"))
Q1: locks t1.lockref (in queue_wait_core)
Q2: locks LOCK_open (in open_table)
Q2: tries to lock t1.lockref (in ha_queue::open)
Q1: tries to lock LOCK_open (in queue_share_t::get_share("t2"))

note: Q2 only tries to lock LOCK_open if the table is not in open_cache