Update capture.cpp

Fixes a _very_ critical bug which would randomly cause a segmentation fault by the kernel and thus result in a kernel panic.