Postgres - Check for locked queries