fixed sem_unlink() bug and request buffer parse bug

sem_unlink() should come after sem_open() so the semaphore is
immediately close on program exit. The response buffer was null
terminated one character too soon, fixed by using the parser's nread
var instead of state's nread (now deleted).