Close new pipe to background process immediately

Otherwise it would be left open for at least the lifetime of the process
object, and garbage collection would trigger a ResourceWarning.

Also rename the “stdin” variables to be less confusing.
Close the error output stream once it has been passed to the subprocess

Avoids a ResourceWarning in Python 3.
Close the player’s redirected input and output streams

This avoids ResourceWarning warnings in Python 3.

Also, close the input to the player process before killing it. Some players
will then terminate of their own accord, including MPV, M Player, and VLC
with “vlc://quit” at the end of its playlist.

This also disables buffering of the input pipe in all Python versions. Recent
versions of Python 3 would otherwise enable buffering by default, and this
causes trouble when closing the input pipe and the pipe is broken.