Fixed note display for deleted person/company

When you delete a person or a company, the assigned notes (memos) are
nullified. The note still exists with person_id or company_id set to
nil. This caused an error on the notes display when trying to link back
to the non existent person/company.