Added support for savepoints.

Hi,

This patch handles savepoints in a similar manner to how the postgres_fdw extension ([connection.c](https://github.com/postgres/postgres/blob/fc9f4e9f8c981bbc050e5566cf558112c938da2c/contrib/postgres_fdw/connection.c)) behaves, keeping track of the current depth of transactions and forwarding that information to the python instance.