Fix for nullable foreign key as cache partition.

EF sets null nullable foreign key properties during delete which causes
a partition cache on that key to fail to increment the partition
generation. We now detach the entity first, then get a new attached
entity via PK and use that to delete. This maintains the Nullable<FK>
property value for the partition key generation.