pipe: read buffer limits atomically