Fix Postgresql JDBC driver leaking memory

Older versions of Postgresql JDBC driver rely on finalize() methods in
order to avoid leaking unclosed database objects. Given finalize
methods are unpredictable (no guarantee about prompt execution, if at
all), in some high load environments this could lead to a memory leak
with millions of JDBC objects pending finalization.

Newer versions of the Postgresql JDBC driver removed the use of finalize
methods to avoid this kind of issues.

Also provides an implementation of setQueryTimeout.

Bug: Issue 4848
Change-Id: Ia143f1df1d8e41686362fd76b9bc82e0046f9894
(cherry picked from commit 80476a51df8361814e9cd5d91ceb60e8bf41cae5)
diff --git a/lib/BUCK b/lib/BUCK
index 38eb330..c132863 100644
--- a/lib/BUCK
+++ b/lib/BUCK
@@ -156,8 +156,8 @@
 
 maven_jar(
   name = 'postgresql',
-  id = 'postgresql:postgresql:9.1-901-1.jdbc4',
-  sha1 = '9bfabe48876ec38f6cbaa6931bad05c64a9ea942',
+  id = 'org.postgresql:postgresql:9.4.1211.jre7',
+  sha1 = '56b01e9e667f408818a6ef06a89598dbab80687d',
   license = 'postgresql',
   attach_source = False,
 )