Fixed possible NULL dereference in pico_frame_discard()
Fixed potential NULL dereference in pico_device.c