Use libuv CFLAGS and LIBS when checking for features [v9.18]

Merged Ondřej Surý requested to merge 3366-configure-fails-to-find-uv-h-on-bsd-v9_18 into v9_18

When autoconf was checking for libuv features, the LIBUV_CFLAGS was not added to CFLAGS and LIBUV_LIBS to LIBS which resulted in false negatives.

Use AX_SAVE_FLAGS and AX_RESTORE_FLAGS to temporarily add LIBUV_CFLAGS and LIBUV_LIBS to their respective variables.

(cherry picked from commit f063ee27)

Closes #3366 (closed)

Edited by Ondřej Surý

Merge request reports