I have no objections on this class, but IMO it would be better if we have generic RAII wrapper modelled similarly to ```std::{unique|shared}_ptr``` that allows to plug custom deleter. Concept presented here: https://github.com/mloskot/workshop/blob/master/postgresql/tinypq.hpp#L27-L43