Add before_put_image_json signal

Add before_put_image_json signal that allows receivers to short-circuit
the put if they return any non-None value. This can be useful for things
such as enforcing quotas, e.g. by having a custom extension connect to
this signal, check the layer's Size, and returning something to the
effect that the put was denied due to quota.

Signed-off-by: Andy Goldstein <agoldste@redhat.com>
Add standalone as default example
Merge pull request #607 from ncdc/new-put-json-signal

Add before_put_image_json signal
Add refcount extension

Add refcount extension to store image references and cleanup orphans.
Based heavily on @wking's work in
https://github.com/docker/docker-registry/pull/409 - this is just an
adaptation to extension format.

Signed-off-by: Andy Goldstein <agoldste@redhat.com>