Merge pull request #12 from tornewuff/detach_better

Close stdin/out/err before forking.