Fix regexec() error checking in grep_text() and grep_refs()

regexec() returns 0 for success and the non-zero code REG_NOMATCH for
failure, so it should be '!result' instead of 'result != REG_NOMATCH'.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>