remove shadow declarations and make variable read only when possible

The rtc global variable was shadowed multiple times by function argument
of same name.  Since the global variable is used only in signal handler
it was easier to change it, rather than all of the other 'rtc' variables.

In same go make everything read only that can be made such.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>