Safari 5.1 (OS X Lion) Inspect Element / Web Inspector always pops up and is not docked to main window
At the bottom left hand corner of the popup there is a little button that looks like a dark square with a white square in it. That button pops the inspector in and out. 

Don't know if that will fix your problem but you can try