lib: Use g_return_if_fail() for function returning void

Squashes a compiler warning I saw from Continuous.