Fix bug of removing pipe with the current priority

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>