receive-pack: reorder some code in unpack()

This is the preparation for adding --shallow-file to both
unpack-objects and index-pack. To sum up:

 - status/code, ip/child, unpacker/keeper and i (now ac) are moved out
   to function top level

 - successful flow now ends at the end of the function
send/receive-pack: support pushing from a shallow clone

Pushing from a shallow clone using today's send-pack and receive-pack
may work, if the transferred pack does not ends up at any graft
points. If it does, recent receive-pack that does connectivity check
will reject the push. If receive-pack is old and does not have the
connectivity check, the upstream repo becomes corrupt.

The pack protocol is updated and send-pack now sends all shallow
grafts before it sends the commands, if the repo is shallow. This
protocol extension will break current receive-pack, which is intended,
mostly to stop corrupting the upstream repo.

Changes on the receiver are similar to what has been done in
fetch-pack.
send-pack: support pushing to a shallow clone

When send-pack receives "shallow" lines from receive-pack, it knows
the other end does not have a complete commit chains. It restrict
itself to the commits that are not cut out by either end to make sure
the result pack is usuable by receive-pack.

The same technique here, using setup_alternate_shallow() and
--shallow-file, might simplify similar code in upload-pack.
{fetch,upload}-pack: support fetching from a shallow clone via smart http
receive-pack: support pushing to a shallow clone via http
send-pack: support pushing from a shallow clone via http
git-clone.txt: remove shallow clone limitations

Now that git supports push/pull from/to a shallow clone, these
limitations are not true anymore.
clone: use git protocol for cloning shallow repo locally

clone_local() does not handle $SRC/shallow. It could be made so, but
it's simpler to use fetch-pack/upload-pack instead.

This used by be caught by the check in upload-pack, which is triggered
by transport_get_remote_refs(), even in local clone case. The check is
now gone and check_everything_connected() should catch the result
incomplete repo. But check_everything_connected() will soon be skipped
in local clone case, opening a door to corrupt repo. This patch should
close that door.