hash: fix NULL return value in hash_get()

When passed a NULL parameter, hash_get() wasn't returning a value.
It should have been returning an error condition (-1). This patch
fixes it.