configure: add optional pkg-config helper and use it.

The require variant dies if the package is not present.
The check variant does not import the flags to the used list.
The new variant imports the flags if the package is present
but does not die if it is not.
The new call graph is: require -> use -> check.

Use use_pkg_config for libx264 and libsmbclient: more readable
and three external call less per library.
