I don't use dmenu. Do you know anything about how it starts processes? When it locks up and you ssh in, what state are the processes behind the open windows in? I wonder if they are stopped on tty input (STAT T in "ps x").