shared: Only update serialize pointer when operation succeeds

Prior to this commit, if a serialize call failed from gdbm, bt-daemon
would crash due to a double free. This commit rectifies the issue by
only updating the pointer when we successfully serialize data.

Signed-off-by: Michael Ikey Doherty <michael.i.doherty@intel.com>