Make kill close stdin before killing process