Get tid as integer from tid array returned by EntityFieldQuery
The standard(?) pattern to get ids from a query over a single entity type is to use array_keys().  Something like this:

function get_tids_from_custom_field($vocabulary, $field, $value) {
  $vocab_machine_name = taxonomy_vocabulary_machine_name_load($vocabulary);
  $query = new EntityFieldQuery();
  $query
    -&gt;entityCondition('entity_type', 'taxonomy_term')
    -&gt;entityCondition('bundle', $vocabulary)
    -&gt;propertyCondition('vid', $vocab_machine_name-&gt;vid)
    -&gt;fieldCondition($field, 'value', $value, '=');

  $results = $query-&gt;execute();         

  return !empty($results['taxonomy_term']) ? array_keys($results['taxonomy_term']) : array();
}


The results array is keyed by the entity ID.