Add error reporting to lock fail
Free resources in store tests