libhb: Split nlmeans median filter into a separate function.
libhb: Rename nlmeans prefilter median to mean, since that is what it actually does.

Minor refactoring for readability.