Add escapeIdentifier

There's probably a lot of locations in postgresql-libpq that need a
mask_ to avoid memory leaks in the presence of asynchronous exceptions.