Adds the option `use_threads` to PTY (enabled by default) which improves
performance when enabled. For example, running `time cat file.txt` where
file is ~4.5MB will take ~0.250s with threads enabled, versus >20s when
disabled.
Adds method to convert env from a Dictionary to a PackedStringArray so
it can be used with fork(). Consider making env a PackedStringArray to
begin with.