Server: Fix deadlock in libdatastorage