PostgreSQL - Wait for async notifications with socket select `pg_wait_notify`

Hi,

This builds on some work to the PostgreSQL extension from #799

It adds a php function `pg_wait_notify` similar to https://bugs.php.net/bug.php?id=44348, except that it uses `select` instead of `poll`.

It's also based upon postgresql example code (http://www.postgresql.org/docs/9.3/static/libpq-example.html #2).

Issue:
If you're waiting for async notifications. You must continually call `pg_get_notify`, with interleaved calls to `usleep`; which is inefficient.

Solution:
Use something like `poll` or `select` with optional timeouts to save on resources.

Example usage:

```php
<?php
$conn = pg_connect("dbname=test");
pg_query($conn, "LISTEN test_channel");
// in another thread/connection, query "NOTIFY test_channel" 
// waits up to 30seconds for a notification before terminating
if(pg_wait_notify($conn, 30)){
   while(($x = pg_get_notify($conn)) !== false){
     var_dump($x);
   }
}

```

I'm making this requests against PHP-5.4, as it's backwards compatible - and if successful, I'll merge/port it forwards to 5.5, 5.6/devel