fixed: write to the port buffer after allocating it, to make sure the kernel completely allocated it, this prevents doing that from the jack realtime thread and possibly blocking on it