Fix the InMemoryAdapter so it properly cleans up the Detail/Master records on join table delete.
Added a test for the scenario.