fix reflog/signature leak in reflog_write

If there was an error appending or writing to the reflog
nothing was being freed.
fix signature/object leak in tag_create

If the message is not a string both the target object and tagger
signature were not freed.
fix memory leak when passing invalid parents type

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