Add naive method to invalidate nscd caches when databases change

TODO: Check whether system has nscd and whether it is running.
Also unit tests.

Fixes #47 but is currently rubbish, however this might annoy someone enough that they improve my code.
I changed these around to make the code easier to follow, I guess a better check would be `$? == 0`, I'm not a fan of having the expected outcome interleaved in nested if statements.