patchwork/denoising/nlm_core: add patch metric + fix compilation bugs.