Refactor type_from_string() to avoid die()ing in case of errors

In the next commits, we will enhance the fsck_tag() function to check
tag objects more thoroughly. To this end, we need a function to verify
that a given string is a valid object type, but that does not die() in
the negative case.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
fsck: inspect tag objects more closely

We inspect commit objects pretty much in detail in git-fsck, but we just
glanced over the tag objects. Let's be stricter.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>