build: some fixes in configure.ac

- Use 'test =' instead of 'test ==' in the x11 test. The second one
  might not work with e.g. dash, whoops.

- Use AS_IF instead of 'if'. It actually blends in better..

Signed-off-by: Ran Benita <ran234@gmail.com>
Use secure_getenv when available

We probably don't want to get a privileged process to compile arbitrary
keymaps. So we should be careful about the envvars which control include
paths or default RMLVOs. But then secure_getenv is more sensible for
everything we do.

Signed-off-by: Ran Benita <ran234@gmail.com>