Convert a static function to an anonymous namespace.

The namespace block was there anyway (containing only this
function), just with a name.
Fix to unit abilities sometimes matching too often.

Abilities are sometimes checked at locations other than a unit's
current location. If the checked location is adjacent to the unit's
location, then (before this fix) the unit could affect itself as an
adjacent unit.