refdb: Change write() to accept a flatten reference
refdb: Change delete() to accept a reference name
refs: Enforce reference deletion test coverage

Also fix a uninitialized variable runtime issue.
refs: Introduce git_reference_delete_byname()
Fix MSVC compilation warning