serial: serial_core: Perform NULL checks for release/request_port ops