Fix get_record_id to return only the requested id

This fixes get_record_id to return the requested record id checking
both the record name and the record type.

Change-Id: I51ab0c92a2749442789a765d06aa62abd3a068ae
Closes-Bug: 1363425
Merge "Fix get_record_id to return only the requested id"