block: get mountpoints from /proc/self/mountinfo
Instead of using two different implementations reading /proc/mounts
and /proc/self/mountinfo, gather all information on mountpoints from
/proc/self/mountinfo.
While at it, tokenize mountinfo inline instead of using strtok_r
because it's hard to tell whether strtok_r allocated new memory or
merely returns a pointer to the (last) token. This might later on be
relevant once we want to free that memory...
Tokenizing mountinfo using strchr inline works without allocating any
new memory by scanning and re-writing the string returned by gets().
As a result, the returned string needs to be duplicated to be safe for
use even after the fclose().
Signed-off-by: Daniel Golle <daniel@makrotopia.org>