To unqueue from the (random) battleground and arena queue,
simply hit the "H" key, which will take you to the PvP screen. On
the second tab, there should be a button at the bottom reading
"Leave Queue". Pressing this will remove you from the queue.
It is the same button (now: Enter Queue) which you use to enter
the queue in the first place.