builtin-remote: refactor duplicated cleanup code
builtin-remote: refactor duplicated cleanup code

This patch moves identical lines of code into a cleanup function. The
function has two callers and is about to gain a third.

Also removed a bogus NEEDSWORK comment per Daniel Barkalow:

  Actually, the comment is wrong; "remote" comes from remote_get(),
  which returns things from a cache in remote.c; there could be a
  remote_put() to let the code know that the caller is done with the
  object, but it wouldn't presently do anything.

Signed-off-by: Jay Soffian <eccf10a4397cf08f0034a6cb5e4457bdd5e3783e@gmail.com>
Signed-off-by: Junio C Hamano <a6723cc3f76163bf7adb636a73ac3b0ceb3e6b9b@pobox.com>

destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git