PHP: long running process with closed connection