Reduce the timeout to zero seconds when running in a container (LP: #1760173)

When inside a lxd container with zfs storage, zfs list or zpool status
appears to hang, no output for 10 seconds. Check if we are inside a
container and set the timeout to zero in this specific case.

---

--- a/lib/libzfs/os/linux/libzfs_util_os.c
+++ b/lib/libzfs/os/linux/libzfs_util_os.c
@@ -107,6 +107,15 @@
 	int load = 0, fd;
 	hrtime_t start;
 
+	/*
+	 * If inside a container, set the timeout to zero (LP: #1760173),
+	 * however, this can be over-ridden by ZFS_MODULE_TIMEOUT just
+	 * in case the user explicitly wants to set the timeout for some
+	 * reason just for backward compatibilty
+	 */
+	if (access("/run/systemd/container", R_OK) == 0)
+		timeout = 0;
+
 	/* Optionally request module loading */
 	if (!libzfs_module_loaded(module)) {
 		load_str = getenv("ZFS_MODULE_LOADING");
