NULL pointer dereference.
Use prepared statements for generating the savepoint name.

This removes the FIXME, and feels leaner.
Merge pull request #182 from tiennou/stuff

Some fixes