Add git_reference_free call when looking up a reference
Add git_reference_free call after creating a branch
:lipstick:
Ensure that the first parameter starts with "refs/heads/"
:lipstick:

Most of these have to do with:
* rearranging variables
* cleaning up memory after `git_` function calls
* removes excess curlies