Did you loose the key that the first guard drops (required to rescue Tax in the north east cell) or the key on the table to the west (required for the imp in the south west cell)? Check at the entrance and to the west holding down the alt key, to make sure you actually picked up both keys (there is a lot of stuff around the west key you may have clicked on by mistake).
I can get the
Inventory files in awhile so you can replace they key(s).
If you are comfortable hex editing, you can have one character bypass the locked door to talk to the imp, and have the other character leave the prison to get the first out of the cell again.
Teleporting anywhere (via hex editor)Alt-tabbing out of the game can sometimes shift character positions slightly, which might allow you to get past a cell wall.
Sometimes there is a bit of a gap in the north west corner of a room or building. Neither cell quite fits this arrangement, since one of the walls continues past that corner, but you could check if you can see and talk to the imp from outside.