test to reproduce behavior of issue brianc/node-postgres#549

for brianc/node-postgres#549

With some console.log, the output looks like:

```
$ node test/integration/client/query-error-handling-prepared-statement-tests.js 
query-error-handling-prepared-statement-tests.js.handleError
lib/query.js isPreparedStatement -> connection.sync
lib/query.js callback
client.end()
lib/client.js client.end
lib/connection.js Connection.end
lib/query.js callback return
```
copy of query-error-handling-tests.js
a fix was provided in 5079c1e0c41f431ac2e02c40ebd875d8fbb34004

I would suggest that I provide additional CLs to refactor killIdleQuery in test-helper to reduce duplicated code.