dsdb: Fix error checking conditions in partition_metadata module