Handle tab overflow gracefully

The behavior is based on Safari.

This attempts to address #1060