Turns standard input (possibly a pipe) into a seekable file descriptor. Originally by @geocar circa 2004.