util/server: Fix the timing to close() the PID file
The PID file is closed just before pidfile function returns.
However, if close() is called immediately after read()/write(),
there is no need to call close() at multiple places.
Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>