remote-hg: skip ill-formed references

References which fail check_refname_format() cause
the whole import to fail. This might be undesirable
if the references are not important.

A better solution would be to provide some mapping,
either by some 'standard' biridectional encoding,
or by generating and storing the associations locally.

But this is already going to allow working with many existing
repositories.
version2: fix comment