backporting the fix from the MOZILLA_1_8_BRANCH to work on the trunk (both with places enabled and without) r=dietrich, original patch r=mconnor, ui-r=beltzner git-svn-id: svn://10.0.0.236/trunk@213472 18797224-902f-48f8-a5cc-f745e15eee43