zdtm: add test cases on TCP_FIN_WAIT* states

TCP_FIN_WAIT1 our side has shutdown, waiting to complete
              transmission of remaining buffered data

TCP_FIN_WAIT2 all buffered data sent, waiting for remote
              to shutdown
zdtm: add test cases on TCP_CLOSE_WAIT and TCP_LAST_ACK states

TCP_CLOSE_WAIT remote side has shutdown and is waiting for
               us to finish writing our data and to shutdown
               (we have to close() to move on to LAST_ACK)

TCP_LAST_ACK   out side has shutdown after remote has
               shutdown.  There may still be data in our
               buffer that we have to finish sending
zdtm: check sockets in the TCP_CLOSING state

TCP_CLOSING both sides have shutdown but we still have
            data we have to finish sending
tcp: add support of intermediate closing states

The size of fin packet is 1, but it can be received, but fin packet
doesn't contain user data. For this reason we need to adjust the size
data in a send queue.
tcp: allow to dump intermediate closing states
zdtm: add test cases
zdtm: add socket-tcp-*.opts
zdtm: check fin-wai1 without data
debug
test/mountpoints: clean up

All mounts is marked as private for one call, so we don't need the
variable private, which has been added in "(55fe0939088d) zdtm: don't
destruct an external mount-namespace"
last_ack
socket-tcp-syn-sent
tcp: restore sockets in the syn-sent state

For that we transfer socket in nonblocking mode, set sequence numbers,
disable repair mode and call connect(), which is returned EINPROGRESS.
zdtm: rollback cwd only if a test case is executed in namespaces

$ bash test/zdtm.sh -i 0 '\(ns/static/env00\|static/pty03\|static/mountpoints\)'
...
==================================== ERROR ====================================
Test: zdtm/live/static/mountpoints, Namespace:
Output file: /root/git/1/criu/test/zdtm/live/static/mountpoints.out
------------------------------------------------------------------------------
00:53:03.267: 26935: FAIL: mountpoints.c:139: Can't umount all the filesystems (errno = 16 (Device or resource busy))
------------------------------------- END -------------------------------------
================================= ERROR OVER =================================

Fixes: 0198590c5a44 (zdtm: Factor out starting the test via Makefule)
Signed-off-by: Andrey Vagin <avagin@openvz.org>
mount: execute collect shared for all mounts

Currently collect_shared is executed for each mount namespace separately,
so we can skip dependencies between namespaces.

For example we can have two namespaces.
The first one contains a tmpfs mount and the second one contains a
non-root bind-mount of this tmpfs. Without this patch this example can't
be dumped.

On restoer mnt_build_tree() is called for all namespaces, so we have not
got bugs yet.
mount: save remapped links on tmpfs

For that mnt namespaces should be dumped after files.
mount: don't set m->bind if m is already mounted

m->bind will be used to get the lowest mount.

mount is "lowest", if m->bind is NULL. The "lowest" moutn is mounted, all
other are bind-mounted from it.
mount: save local mount point paths on restore

On restore we add a temporary root to a mount point path. It's convinient
for restoring mount namespaces, but real paths are used for restoring
link-remap files.
mount: add helper mntns_get_root_by_mnt_id
ghost: create ghost devices and directories in a specified ns

Here is a bug now. A path for devices and directories should be
generated with a specified root.