Fix malformed tooltips on shared query

Fixes #380.

This overcomes a bug in bootstrap versions < 3.0 where tooltips are not
placed correctly within nested elements. This can be removed later after
we upgrade to bootstrap >= 3.0 but this is a documented and bootstrap
recommended workaround until that point.