CRM-13490 : fix for warning mentioned by dgg in issue comment (CRM-13490?#comment-53786), also code some improvement

----------------------------------------
* CRM-13490: Addresses with required custom fields can't be deleted from the Edit screen
  http://issues.civicrm.org/jira/browse/CRM-13490
Merge pull request #1842 from pratik-joshi/CRM-13490

CRM-13490 : fix for warning mentioned by dgg in issue comment (CRM-13490?#comment-53786), also code some improvement