Use with_c_str() instead of the long form

Thanks, Eridius!
Rewrite detached_sessions to use filter_map

...and take advantage of the type inference. Seriously, this is probably
the nicest type handling I've seen so far. Wow. (Thanks, dbaupp and
strcat for the golf advice!)