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.
Add a /* fall through */ comment for all switch case fall throughs.

This should server as a message to coverity that the fall through is
intentional.
Clean up function syntax

Remove space before ( in function names. Put { on new line.
Make tests static.
Correct indentation and wording of comments.