Ahaggar: improve extract_location() logic to not modify substring

Make the extract_location() function work on an internal copy of the
substring in order to preserve it for next calls

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>