Releasing statement handlers in database

Added release for statement handlers in the database handler