fix memory leak when passing invalid parents type to Commit.create

Passing invalid parents type to Commit.create just raises
an exception without freeing the allocated signatures,
arrays and tree obj.