Add type checking to set function

This commit check the type of the set() function
parameters as done in Kazoo.