crush: check for invalid names in loc[]

Add the is_valid_crush_loc helper to test for invalid crush names in
insert_item and update_item, before performing any side
effect. Implement the associated unit tests.

Signed-off-by: Loic Dachary <loic@dachary.org>
Merge pull request #901 from dachary/wip-crush-unittest

crush: check for invalid names in loc[]

Reviewed-by: Sage Weil <sage@inktank.com>
Merge git://github.com/ceph/ceph