ReceivePackHandler: only compute sorted refs if they will be used.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Merge branch 'master' of git://github.com/jelmer/dulwich