osc.c: Make the helper functions for plugins safer
 - This fixes the bug that causes a crash when the "Rx Cal" button of the fmcomms1 plugin gets pressed.

Signed-off-by: Dan Nechita <dan.nechita@analog.com>