Fixed a deadlock in case of using `rayon` thread pool with only one thread to resize with `ResizeAlg::Nearest` algorithm.