
  -spec port_close(Port) -> true when Port :: port() | atom().

  Closes an open port. Roughly the same as Port ! {self(), close}
  except for the error behavior (see below), being synchronous, and
  that the port does not reply with {Port, closed}. Any process
  can close a port with port_close/1, not only the port owner (the
  connected process). If the calling process is linked to the port
  identified by Port, the exit signal from the port is guaranteed
  to be delivered before port_close/1 returns.

  For comparison: Port ! {self(), close} only fails with badarg
  if Port does not refer to a port or a process. If Port is a
  closed port, nothing happens. If Port is an open port and the
  calling process is the port owner, the port replies with {Port,
  closed} when all buffers have been flushed and the port really
  closes. If the calling process is not the port owner, the port
  owner fails with badsig.

  Notice that any process can close a port using Port ! {PortOwner,
  close} as if it itself was the port owner, but the reply always
  goes to the port owner.

  As from Erlang/OTP R16, Port ! {PortOwner, close} is truly
  asynchronous. Notice that this operation has always been
  documented as an asynchronous operation, while the underlying
  implementation has been synchronous. port_close/1 is however
  still fully synchronous because of its error behavior.

  Failure: badarg if Port is not an identifier of an open port,
  or the registered name of an open port. If the calling process was
  previously linked to the closed port, identified by Port, the
  exit signal from the port is guaranteed to be delivered before
  this badarg exception occurs.
