1st round of bug fixing for oBIX 1.2.1

Valgrind on both server side and client side passed.