Implement non-blocking locks with PostgreSQL

Change-Id: Id0f2f10bf9d284343c19ba395a90aea7b9233124