messages/outbox: Fix undefined var warnings

This code needs urgent refactoring. I just applied something similar to
what other files in this module are doing.
lib/messages.lib: Undefined variable warning
Merge pull request #238 from diegoe/1.9_empty-outbox-warnings

1.9 empty outbox warnings