[services-ng] add timeout to query and support async query method of ruby-pg

Change-Id: Ib4becae19bdae77f3c0734ceae704d5c6b6ef3fc