Optimized frame manipulation

When doing a webcam_grab, it will re-use the passed frame's buffer, so
only calloc'ing once during the grabbing process. This should speed up
the program.

Also added a signal handler for segfaults, to cleanly close the opened
webcam devices, so that they are available for a next run.