pg_pconnect() has known problems. Change to pg_connect() and see if your problems go away; mine certainly did.
In the average script, using pg_close() is pretty much a matter of personal choice regarding style and housekeeping. Just like closing file descriptors with fclose(), some will insist on it, while others will say, "In two lines my program is exiting, at which point all that stuff will be closed automatically anyway!"
The one case where pg_close() is when you're done using the database, but the script might run for quite a while longer (which, in webserver terms, could be as little as a second or two.) In this case, closing the connection frees it up for another user.
Finally, 25 connections is not very many if you're expecting any load of traffic. You should see about increasing that, and some of the other performance-related postgresql back end configuration items (buffer count and size, etc.)