Fix a couple of races around toolbox opening and tool selection by waiting for the actual tool panel to be selected (bug 988408). r=jwalker

--HG--
extra : rebase_source : d2f51db8c202d35b2aa72f4df1669162f011d89d