Fix pool.query to use typeCast configuration

fixes #894