fix(streams): close the file descriptor when the stream ends

perhaps emit an error for lua? I fear most people aren't going to pcall() these  functions