Pass down Ruby string instead of C string

This fixes a use after free issue with the postgres driver.