Don't keep focus on mouse clicks on tabs

This fixes #9984.