"Is there a simple way of protecting against that?"
No.
The database simply does not have enough available connections.
MySQL has a configurable limit on the number of concurrent connections, and your database server has reached it's limit.
The only thing you can do about it is use fewer connections, but that means fewer pageviews, or increase the number of concurrent connections that the database allows.
BTW, if you are using persistant connection (mysql_pconnect), switch that off immediately, that keeps connections open even if the script has stopped, and that uses a sh*tload of resources, especially on a shared server.