vfs: leak: Release refcnts hold by main_task structure on shutdown

Whenever you change the working directory through either fchdir or chdir,
a file structure holding refcnts to the underlying mount point is set to
the field t_cwdfp of main_task. If t_cwdfp was previously set, then the
older data will be freed and replaced by the newer one.
The problem exists because these refcnts are never released afterwards.

Changes introduced by this patch:
1) Create a function and use lambda to reuse as much code as possible
(Suggested by Glauber Costa).

2) Create vfs_exit that will use the function previously created to
free up main_task resources, and call unmount_rootfs afterwards.
Needless to say, vfs_exit replaces the function unmount_rootfs at the
shutdown procedure.

After applying the changes described above, the refcnt leaks on the root
mount point are gone.

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>