chanserv/topicswap: better parameter checks to avoid crash

Fixes atheme/atheme#400.