More rigerous pipe code

- New thread handling the pipe, freeing the main thread from waiting
- Move debug mode 17 from pipe end to pipe mutex