replace tmp-dir option by env. variable TMPDIR
some code cleanup
fix free raw devices list when mount index exceeds attached devices count
fix free raw devices list after devices listing
fix typo in man page
fix freebsd build

based on bugmen0t input