threshold: register threshold host storage. Related to bug #991
storage: fix freeing storage

Fix freeing storage. Also add workaround for unittests that don't
(fully) setup storage.

Bug #991.