check-code: only fix patterns once

The patterns were fixed once for every file. Now only do it once when loading
the file.
check-code: compile all patterns on initialisation

They where compiled once for every checked file (when calling finditer).
check-code: compile filters when loading
check-code: introduce function for using re2 when available

Do it similar as in mercurial.util. For simplicity only support flag
multiline which is the only one used.
run-tests: ignoring tests works again

running with --retest did not work anymore because runone still returned None
for this case. But this is not allowed since 6a127fa5de23.
run-tests: call Threads constructor with keyword arguments

This is suggested in the python documentation
(on http://docs.python.org/2/library/threading.html#thread-objects)
hg: move return statement after finally block

return is always run after finally block. Now we have same functionality,
but clearer readability.
filectx: remove dependencies on filerev

Removing dependencies on filectx.filerev() makes it easier to create a filelog
implementation that doesn't have rev numbers.
run-tests: sort missing files first instead of raising an error

sort first for early telling typos in test names